You asked "why" it happens. It happens because the answer depends on the whether R is greater or less then 0, and you have not told Maple what to do about that. In the syntax of Maple's int command the range 0..R does not by itself imply that R is greater than 0. That syntax also allows for inverted ranges.
When I execute your original call I get the following warning in addition to the unevaluated result.
int(x^2*sqrt(R^2-x^2),x=0..R);
Warning, unable to determine if -R is
between 0 and R; try to use assumptions
or use the AllSolutions option
Warnings are usually emitted for a good reason, and it is a good idea to learn to try and read them. Suitably following either of its two suggestions can obtain an answer.
The following answer contains a piecewise.
int(x^2*sqrt(R^2-x^2),x=0..R,allsolutions);
4 /{ -1 R <= 0\
1/16 R Pi |{ |
{ 1 0 < R /
Using assumptions we could separately attain either of those two conditional results.
int(x^2*sqrt(R^2-x^2),x=0..R) assuming R>0;
4
R Pi
-----
16
int(x^2*sqrt(R^2-x^2),x=0..R) assuming R<0;
4
R Pi
- -----
16
Another good idea is reading the Help page for the int command, and its related page for Help topic int,details. These are avaliable offline, in the product's own Help system. It contains examples of the functionality I used here.
int(x^2*sqrt(R^2 - x^2), x)? – Eric Towers Oct 24 '21 at 23:07xorRalso evaluates in your Maple session and this prior definition of that name is causing problems here. It's a guess, I could be wrong. Just evaluatingxand thenRwill determine if this guess is correct. – Eric Towers Oct 24 '21 at 23:13