MATLAB: How to find an unknown constant in an integral equation

integralMATLABunknown

I have been trying to use numerical methods to find the unknown constant C in the following equation:
0.05=integral (limit 0 to 1.8) [1/(C-22x^1.5-9(x-0.5)^1.5) ] dx
How could I do this in Matlab?
Thank you for your advice.

Best Answer

It depends on what you want to do.
To find a value of ā€˜Cā€™ that provides the minimum value for the integral:
IntFcn = @(C) integral(@(x) 1./(C-22*x.^1.5 - 9*(x-0.5).^1.5) - 0.05, 0, 1.8);
Cval = fminsearch(IntFcn, 1)
produces:
Cval =
1.05
while:
IntFcn = @(C) integral(@(x) 1./(C-22*x.^1.5 - 9*(x-0.5).^1.5) - 0.05, 0, 1.8);
Cval = fminsearch(@(C)norm(IntFcn(C)), 1)
produces:
Cval =
13.6007797241226
More information is always better.