Solving $a\sqrt{1-x^2} + \log(x) = b$ for $x \approx 0$

95 Views Asked by At

I have to solve this

$$a\sqrt{1-x^2} + \log(x) = b \tag{1}$$ for $x \approx 0$ where $a$ and $b$ are two constants and $x>0$.

One (maybe naive) approach is to approximate $\log(x)$, which I asked here. (However, this is not XY problem because I do use the approximation of $\log(x)$ for other problems, so please do not mark it as duplicated)

Another way I tried is to allow $\sqrt{1-x^2} \approx 1$ then $$x \approx e^{b-a} \tag{2}$$

Even though the result of (2) is quite good, it is not satisfactory. Could anyone propose other solutions better than (2)?

2

There are 2 best solutions below

2
On

If you are looking for an approximation for $x$ small then we have

$$ \sqrt{1-x^2}\approx 1-\frac12x^2$$

and then

$$a\sqrt{1-x^2} + \log(x) \approx a-\frac12 ax^2+\log x\approx a+\log x $$

and

$$a+\log x =b \implies x=e^{b-a}$$

is a nice first order approximation.

To obtain a better approximation we need to solve

$$a-\frac12 ax^2+\log x=b$$

which can be solved numerically starting for the solution found by the first order approximation.

3
On

Your equation is equivalent to $a\sin\theta+\log\cos\theta = b $, which can be solved through Newton's method both in the case $\theta\approx 0^+$ (in such a case we consider as a starting point a solution of $a\theta-\frac{\theta^2}{2}=b$) and in the case $\theta\approx\frac{\pi}{2}^-$ (in such a case we consider as a starting point the solution of $1+\log\left(\frac{\pi}{2}-\theta\right)=b$).