# Prove convexity/concavity of a complicated function

Can anyone help me to prove the convexity/concavity of following complicated function...? I have tried a lot of methods (definition, 1st derivative etc.), but this function is so complicated, and I finally couldn't prove... however, I plotted with many different parameters, it's always concave to $\rho$...

$$f\left( \rho \right) = \frac{1}{\lambda }(M\lambda \phi - \rho (\phi - \Phi )\ln (\rho + M\lambda ) + \frac{1}{{{e^{(\rho + M\lambda )t}}\rho + M\lambda }}\cdot( - (\rho + M\lambda )({e^{(\rho + M\lambda )t}}{\rho ^2}t(\phi - \Phi ) )$$ $$+ M\lambda (\phi + \rho t\phi - \rho t\Phi )) + \rho ({e^{(\rho + M\lambda )t}}\rho + M\rho )(\phi - \Phi )\ln ({e^{(\rho + M\lambda )t}}\rho + M\lambda ))$$

Note that $\rho > 0$ is the variable, and $M>0, \lambda>0, t>0, \phi>0, \Phi>0$ are constants with any possible positive values...

• Is $f$ the function you wanted to optimize in your previous question? :D Edit: Oh no I didn't realized that $f$ is one-variable here! Aug 19, 2011 at 9:52
• Dear Jineon, you are right, this is a part of the equation in my previous question... and btw, in this function only $\rho$ is variable, others are just any positive values. Aug 20, 2011 at 4:11
• @Dobby: Try separating this function out into a sum of functions $g_i(\rho)$ and see if $g_i$ is convex. Oct 24, 2011 at 15:11
• When $\phi = \Phi$ your function is of the form $A/(B \rho e^{\rho t} + C)$ where $A,B,C,t>0$. This should be convex, not concave. Mar 22, 2012 at 19:21

I have often used a Nelder-Mead "derivative free" algorithm (fminsearch in matlab) to minimize long and convoluted equations like this one. If you can substitute the constraint equation $g(\rho)$ into $f(\rho)$ somehow, then you can input this as the objective function into the algorithm and get the minimum, or at least a local minimum.
As for proving the concavity I don't see the problem. You mention in your other post that both $g(\rho)$ and $f(\rho)$ have first and second derivatives, so it should be straightforward, right?