MATLAB: Symbolic integral with symbolic integral limits , how do i code this

symbolic integral

hi all, kindly help me to solve above 2 equations . all symbols are constant and subject is r .thanks

Best Answer

syms r A1 A2 R
M1 = int( sqrt(A1+A2*r^2)*r, r, 0, R)
L1 = int( sqrt(A1+A2*r^2)/(1+4*r), r, 0, R)
You will see M1 given as a piecewise output. That is telling you that if you were able to give some constraints on your inputs, you might be able to come out with a simpler output.
In particular, if you are able to confine your symbols to be real-valued,
syms r A1 A2 R real
then you get a useful closed-form solution for M1.
MATLAB cannot find a closed-form solution for L1. (Some other programs I have tried think about it for a long time; I am not sure yet whether they will come out with anything.)