How to find $x$ for $-\frac{1}{\sqrt{2}x^{\frac{3}{2}}}=-\frac{1}{4}e^{-\frac{x}{4}}\left(A-B\right)$

75 Views Asked by At

The title pretty much explains it; I've had trouble with this because when taking the logarithm of both sides $x$ can never be isolated. I have been looking into the Lambert W function, but I've never applied it before and don't know whether it can solve for $x$ in this instance. I would be grateful for any help.

1

There are 1 best solutions below

1
On BEST ANSWER

$\require{begingroup} \begingroup$ $\def\e{\mathrm{e}}\def\W{\operatorname{W}}\def\Wp{\operatorname{W_0}}\def\Wm{\operatorname{W_{-1}}}$

\begin{align} -\frac1{\sqrt2 x^{\tfrac32}} &=-\frac14 \exp(-\tfrac x4)(A-B) \tag{1}\label{1} . \end{align}

\begin{align} -x^{-\tfrac32} &=-\frac{\sqrt2}4(A-B)\exp(-\tfrac x4) \tag{2}\label{2} . \end{align}

Let $\frac{\sqrt2}4(A-B)=1/c$, then we have

\begin{align} c &= x^{\tfrac32}\exp(-\tfrac x4) \tag{3a}\label{3a} ,\\ c^{\tfrac23} &= x\exp(-\tfrac x4\cdot \tfrac23) =x\exp(-\tfrac x6) \tag{3b}\label{3b} ,\\ -\tfrac16\,c^{\tfrac23} &=x\exp(-\tfrac x4\cdot \tfrac23) =-\tfrac16x\exp(-\tfrac 16\,x) \tag{4}\label{4} ,\\ -\tfrac16x\exp(-\tfrac 16\,x) &= -\tfrac16\,c^{\tfrac23} \tag{5}\label{5} ,\\ \W\left(-\tfrac16x\exp(-\tfrac 16\,x)\right) &= \W\left(-\tfrac16\,c^{\tfrac23}\right) \tag{6}\label{6} ,\\ -\tfrac16x &= \W\left(-\tfrac16\,c^{\tfrac23}\right) \tag{7}\label{7} ,\\ x &= -6 \W\left(-\tfrac16\,c^{\tfrac23}\right) \tag{8}\label{8} ,\\ x &= -6 \W\left(-\tfrac13\,(A-B)^{-\tfrac23}\right) \tag{9}\label{9} . \end{align}

The number of the real solutions is defined by $z=-\tfrac13\,(A-B)^{-\tfrac23}$, the argument of $\W$:

\begin{align} \begin{cases} z\ge0:\quad &\text{ one real solution, }\quad x=-6\Wp(z),\quad x\le0 ,\\ z\in(-\tfrac1\e,0):\quad &\text{ two real solutions, }\quad x_0=-6\Wp(z),\ x_1=-6\Wm(z),\quad 0<x_0<x_1 ,\\ z=-\tfrac1\e:\quad &\text{ one real solution, }\quad x=-6\Wp(-\tfrac1\e)=-6\Wm(-\tfrac1\e)=-1 ,\\ z<-\tfrac1\e:\quad &\text{ no real solutions} , \end{cases} \end{align}

where $\Wp$ is the principal branch and $\Wm$ is the other real branch of the Lambert $\W$ function.

Note that above cases describe the number of solutions in a general case of $\W(z)$, in case of this particular equation \eqref{1}, both $x$ and $A-B$ must be positive, so $z\ge0$ is not an option.

Also, minimum valid difference $A-B$ is reached at $x=6$: \begin{align} \min (A-B) &= \tfrac{\sqrt3}9\,\exp(\tfrac32)\approx 0.86250 . \end{align}

Example in python:

import numpy as np
from scipy.special import lambertw as W

def flhs(x,a_b):
  return -1/np.sqrt(2)*np.power(x,-3/2)

def frhs(x,a_b):
  return -a_b/4*np.exp(-x/4)

A_B=0.9
z=-1/3*(np.power(A_B,-2/3))

print(z)
# -0.35758866096504804

x0=-6*W(z).real
x1=-6*W(z,-1).real

print(x0,x1)
# 4.68190384793268 7.544928735449594

# check:

print(flhs(x0,A_B), frhs(x0,A_B))
# -0.06979933204881004 -0.06979933204881006

print(flhs(x1,A_B), frhs(x1,A_B))
# -0.0341194709980176 -0.034119470998017605

$\endgroup$