# Solving log equation

As part of a problem involving the heat equation, I'm trying to solve this equation for x

$$s\sqrt{\frac{c}{s}} e^{-(4 \log^2(c/s)+x^4)/(8 x^2)}-b\sqrt{\frac{h}{b}} e^{-(4 \log^2(h/b)+x^4)/(8 x^2)} =0$$

Or you can view the equation here in a nicer rendering : equation rendering

Wolfram alpha cannot seem to solve it. I know it has four roots being a quadratic and two trivial asymptotic ones which is $x=\infty$ and $x=0$. I'm interested in only the positive real one. All the variables are $>0$.

Wolfram alpha was able to solve this one

but I have no idea how they did it

-
Once you provide actual numbers, numerical solution methods can be used. That isn't possible with the equation full of variables. – John Habert Feb 7 '14 at 18:44

Rearranging we have

$\large s\sqrt{\frac{c}{s}}exp(-\frac{4log^2(\frac{c}{s})+x^4}{8x^2})= b\sqrt{\frac{h}{b}}exp(-\frac{4log^2(\frac{h}{b})+x^4}{8x^2})$

Taking the logarithm of both sides results in

$\large log(s\sqrt{\frac{c}{s}})-\frac{x^4+4log^2(\frac{c}{s})}{8x^2}=log(b\sqrt{\frac{h}{b}})-\frac{x^4+4log^2(\frac{h}{b})}{8x^2}$

Multiplying throughout by $8x^2$ and moving all the $x$ terms on the left (note that the $x^4$ terms cancel out), we have

$8x^2(log(s\sqrt{\frac{c}{s}}) - log(b\sqrt{\frac{h}{b}}))=4(log^2(\frac{c}{s})-log^2(\frac{h}{b}))$

Resulting in

$\large x=\pm \sqrt{\frac{log^2(\frac{c}{s})-log^2(\frac{h}{b})}{2(log(s\sqrt{\frac{c}{s}}) - log(b\sqrt{\frac{h}{b}}))}}$

Now

$2(log(s\sqrt{\frac{c}{s}}) - log(b\sqrt{\frac{h}{b}}))=2log(\frac{s}{b}\sqrt{\frac{cb}{sh}})=log(\frac{sc}{bh})$

So that we can further simplify $x$ to

$\large x=\pm\sqrt{\frac{log^2(\frac{c}{s})-log^2(\frac{h}{b})}{log(\frac{sc}{bh})}}$

-

Let me rename your constants, so your problem is to determine $x$ from the equation:

$$\alpha e^{-\frac{k_1+x^4}{8x^2}} = \beta e^{- \frac{k_2+x^4}{8 x^2}},$$

note that the exponentials can be splitted and, thus, the $x^4/8x^2$ terms can be cancelled out from each sides of the equation. This leads us to:

$$\alpha e^{-k_1/8x^2} = \beta e^{-k_2/8x^2},$$

or, equivalently to:

$$e^\frac{k_2-k_1}{8x^2} = \beta/\alpha.$$

Take now natural logarithms on both sides to get:

$$\frac{k_2 - k_1}{8x^2} = \ln\frac{\beta}{\alpha},$$

where I have supposed $\alpha, \beta \in \mathbb{R}$. Then it yields the solution for $x$:

$$x = \pm \sqrt{\frac{k_2-k_1}{8 \ln(\beta/\alpha)}}.$$

Cheers!

-