I am looking to find the max value of this function: log(x^(sqrt(2))) - x^3 + 4 I am having trouble with how to go about this problem. Any help is great. What I have right now is:
y =@(x) log(x).^(sqrt(2)) - x.^3 + 4 ;
x0 = 1;
x = fzero(y,x0);
disp(x);
The derivative of $$ \log(x^{\sqrt{2}})-x^{3}+4=\sqrt{2}\log(x)-x^{3}+4 $$ is $$ \frac{\sqrt{2}}{x}-3x^{2}. $$ Setting the derivative to zero and solving for $x$, $$ x=\frac{\sqrt[6]{2}}{\sqrt[3]{3}}. $$ You can check that this is, in fact, the point at which the extrema is attained. Plugging this $x$ into the original function and simplifying, the maximum is $$ \left(24-2\sqrt{2}-\sqrt{2}\log\left(9/2\right)\right)/6\approx3.17408. $$ (P.s. ~ This site is generally not for MATLAB, try stackoverflow instead)