# MATLAB can't symbolically solve a definite integration

4 views (last 30 days)
Diaa on 14 Nov 2022
Edited: John D'Errico on 14 Nov 2022
The following definite integration couldn't be symbolically solved by MATLAB. Is there a way to make it solvable by MATLAB?
The expected integration value is zero since the integrand is an odd function to be integrated over a symmetric interval.
sympref('AbbreviateOutput', false);
syms omega c b gamma phi r theta a A theta1
U = omega*r*c*b*gamma*phi*sin(theta) /2/pi/a^2 * (1 - A^2*a^2/(c^2*r^2 + A^4 - 2*r*c*A^2*cos(theta)))
U =
dUdr = diff(U,r)
dUdr =
intdUdr = int(dUdr, theta, [-theta1, theta1], "IgnoreAnalyticConstraints", true,"IgnoreSpecialCases", true)
intdUdr =

John D'Errico on 14 Nov 2022
Edited: John D'Errico on 14 Nov 2022
Not all problems you can write down have some nuce simple algebraic solution. In fact, almost all problems you can write down do not have one. It is the rare and relatively simple problems that have a solution. We get spoiled, because homework assignments always have a solution. After all, why would your teacher assign something that has no solution, unless they were being particularly unpleasant?
And of course, there ARE problems that in fact, do have a solution, but a solver cannot find it. Sadly, they are difficult, but there is often no magic wand that can be waved, beyond doing good mathematics. Sometimes a transformation exists that the solver did not find. These problems tend to be rather rare though.
Just wanting something to happen is not sufficient though, unless of course, you do have a working magic wand. Mine broke the other day though, and spare parts for magic mathematical wands are hard to come by.

### Categories

Find more on Numeric Solvers in Help Center and File Exchange

R2022a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!