1. ## approximate log(1-x)

Can I approximate log(1-x) with -x, if my $x \leq 0.5$ ?

If i have an optimization problem: maximize A*x + B*log(1-x)
can I exchange with a problem: maximize A*x + B*(-x) ?

2. ## Re: approximate log(1-x)

I don't think you could, have you graphed both functions? This should give you a better understanding.

3. ## Re: approximate log(1-x)

It was a typo. I meant -x.

I plotted both functions and they look very similar for x<0.5

4. ## Re: approximate log(1-x)

Why can't you just find $\frac{d}{dx}(\ln(1-x))$ as part of the overall derivative?

5. ## Re: approximate log(1-x)

$\frac{1}{x-1}$
What does that tell me?

6. ## Re: approximate log(1-x)

Originally Posted by robustor
Can I approximate log(1-x) with -x, if my $x \leq 0.5$ ?

If i have an optimization problem: maximize A*x + B*log(1-x)
can I exchange with a problem: maximize A*x + B*(-x) ?
I suggest you use a truncated version of the MacLaurin Series \displaystyle \begin{align*} \ln{\left(1 - x\right)} = -x - \frac{x^2}{2} - \frac{x^3}{3} - \frac{x^4}{4} - \dots \end{align*} which is convergent when \displaystyle \begin{align*} -1 \leq x < 1 \end{align*}.

So theoretically, yes you could truncate it after the first term, but it won't be very accurate. I would suggest truncating it after three or four terms.

7. ## Re: approximate log(1-x)

For small positive values of x, lets say x<=0.5, or x<=0.25 can I approximate x^2 and x^3 with some function of x?

The reason why I ask is that I cannot have x to the power of something in my objective function

8. ## Re: approximate log(1-x)

Originally Posted by robustor
For small positive values of x, lets say x<=0.5, or x<=0.25 can I approximate x^2 and x^3 with some function of x?

The reason why I ask is that I cannot have x to the power of something in my objective function

Prove it has given you the series of expansion. For $|x| < 1$ increasing powers of x will get smaller so you can simply say high powers are roughly 0 compared to low powers and discard the former.
At which value of x this applies depends on how accurate your function needs to be.

9. ## Re: approximate log(1-x)

Sure, i understand that.

My values of x are 0<x<0.25

I can then approximate: $\log(1-x)= - x - \frac{x^2}{2}$

My question was, can I approximate it with something like:

$\log(1-x)= - x - f(x)$, where f(x) is a linear function of x that is smaller than $\frac{x^2}{2}$?