MATLAB: How to get the root of this function

fzero

clc
clear
syms a;
L=144*(log((125*a)/24)).^2+144*(log((1-a)*125)/9).^2-874.5288*(log(125*a)/6)-757.7544*(log(125*(1-a))/9);
LD=diff(L,a)
LD=0;
feval(LD,1)
I want to get the root of the function LD, and I know variable 'a' belongs [0,1], I tried to use commends about "solve, fzero,feval" all can't work. What's more, I get an imaginary number with the solve command, I am confused.
Could anyone help me, thank you very much!

Best Answer

syms a;
L = 144*(log((125*a)/24)).^2+144*(log((1-a)*125)/9).^2-874.5288*(log(125*a)/6)-757.7544*(log(125*(1-a))/9);
LD = diff(L,a)
LD = 
sol = vpasolve(LD,[0,1])
sol = 
0.28921615002800534847250553832229
Related Question