Maximizing Log Function Involving Absolute Value

47 Views Asked by At

Let $1\leq a < \infty$ and $0<b<1$. Define

$$f(x) = \log(1+ax-|x|b) + \log(1-x-|x|b)$$ for $-1/(a+b) < x < 1/(1+b).$

I would like to find $x$ which maximizes $f(x)$.

Since the two terms, $1+ax - |x|$ and $1-x-|x|b$ are both concave and positive, taking log on both terms preserves concavity. Since the sum of two concave functions is still concave, we have $f(x)$ is concave. Hence, all I need is to find a local maximizer.

Then my naive approach to do so is to simply take the first derivative of $f(x)$:

$$ \frac{d f}{d x} = \frac{a-b \frac{x}{|x|} }{ {1 + ax- |x|b } } + \frac{-1-b\frac{x}{|x|}}{ 1-x - |x|b } $$

and then set the derivative above equals to zero to find the maximizer candidate. But then I got stuck on handling the absolute value $|x|$. I was thinking I have to separate into two cases for $x>0$ and $x<0$ but not quite sure this is the right thing to do. Any suggestion is appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

The derivative of $|x|$ is equal to $\frac{|x|}{x}$ if $x\neq 0$, that is, to $+1$ if $x>0$ and to $-1$ if $x<0$. Using this, you can calculate the derivative for $x>0$ and for $x<0$ as follows: $$f'(x)=\frac{-1-b}{1-x-bx}+\frac{a-b}{1+ax-bx}\quad x>0$$ $$f'(x)=\frac{-b-1}{1-x+bx}+\frac{a+b}{1+ax+bx}\quad x<0$$ and so for $x>0$, the derivative vanishes if and only if $x=\frac{a-1-2b}{2(a-b)(b+1)}$, whereas for $x<0$, the derivative vanishes if and only if $x=\frac{1-a-2b}{2(a+b)(b-1)}$.

2
On

You have two fractions. Add them together using $$\frac ab +\frac cd=\frac{ad+bc}{bd}$$ and then set the numerator to $0$ to see what $x$ satisfies the equation.