What is the correct approach to solving a log equation with more than one non log value? Please demonstrate using the following equation: $$\log(2x-1)=-x+3$$
2 Answers
For an equation that is similar to this one, you will typically need the Lambert $W$ function. I assume that your $\log$ is $\ln$.
$$\begin{align} \ln(2x-1)&=-x+3\\ 2x-1&=e^{-x+3}\\ (2x-1)e^{x-3}&=1\\ \left(x-\frac12\right)e^{x-3}&=\frac12&&\text{make coefficients of $x$ equal}\\ \left(x-\frac12\right)e^{x-1/2}&=\frac12e^{5/2}&&\text{make subtractions from $x$ equal}\\ W\left(\left(x-\frac12\right)e^{x-1/2}\right)&=W\left(\frac12e^{5/2}\right)\\ x-\frac12&=W\left(\frac12e^{5/2}\right)\\ x&=W\left(\frac12e^{5/2}\right)+\frac12\\ \end{align}$$ And $x\approx1.941304330652583916268007448815937227342114287347817503685\ldots$.
- 54,717
As alex jordan answered, there is an analytical solution involving Lambert function. If you cannot or do not want to use it, numerical methods should be required.
Consider the function $$f(x)=\log(2x-1)+x-3$$ and its first derivative $$f'(x)=\frac 2{2x-1}+1$$ It is always positive since, because of the logarithn, $x>\frac12$; so $f(x)$ is increasing and there is a single root.
By inspection $f(1)=-2$, $f(2)=\log(3)-1>0$. So, the root is beween $1$ and $2$.
Let us be very lazy and start Newton iterations at $x_0=\frac 32$ and apply the iterative scheme $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ This will generate as successive iterates $$\left( \begin{array}{cc} n & x_{n} \\ 1 & 1.903426410 \\ 2 & 1.941095404 \\ 3 & 1.941304324 \\ 4 & 1.941304331 \end{array} \right)$$
- 260,315