# how to solve an equation including natural log

I am attemping to solve this equation for X:

1=lnX/0.08//x-0.08

I re-arranged to

x-0.08 = ln x/0.08

then:

0.08X-0.0064 = ln X

X = ?

this is where I am stuck.

Any suggestions?

edit retag close merge delete

For future questions you may ask, I suggest that you use LaTeX to write an equation, since the first expression is not very clear:

$1 = \frac{\ln(x)}{0.08(x-0.08)}$

Sort by » oldest newest most voted

This expression has no analytical solution, therefore you need to solve it numerically. For that, you can use find_root in a given range $0\lt x \lt 2$:

sol = find_root(0.08*x-0.0064 == log(x), 0,2); sol


which will give you,

1.0835990137881888

more

1

It does have an analytical solution in terms of Lambert W function.

Setting $Y:=-(\ln X + 0.0064) = -\ln(e^{0.0064}X)$, we get an equation: $$Ye^Y = -\frac{0.08}{e^{0.0064}},$$ implying that $Y = W( -\frac{0.08}{e^{0.0064}} )$, where $W$ is Lambert W function. Then $$X = e^{- W( -\frac{0.08}{e^{0.0064}} ) - 0.0064}.$$

In Sage we can define a function that computes $X$ depending on a branch of $W$:

def X(branch=0):
return exp(-lambert_w(branch, -0.08/exp(0.0064)) - 0.0064 )


Then X(0) gives 1.08359901378819, X(-1) gives 48.6340483659129, and other branches give various complex solutions.

more