Ask Your Question
0

how to solve an equation including natural log

asked 2021-11-14 21:57:34 +0100

BG gravatar image

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 flag offensive close merge delete

Comments

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)}$

keko gravatar imagekeko ( 2021-11-15 11:06:24 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2021-11-15 15:31:06 +0100

Max Alekseyev gravatar image

updated 2021-11-15 22:35:18 +0100

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.

edit flag offensive delete link more
1

answered 2021-11-15 11:03:07 +0100

keko gravatar image

updated 2021-11-15 11:09:16 +0100

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
edit flag offensive delete link more

Comments

1

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

Max Alekseyev gravatar imageMax Alekseyev ( 2021-11-15 15:31:33 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-11-14 21:57:34 +0100

Seen: 639 times

Last updated: Nov 15 '21