beginner integration trouble.

CODE:
```
syms x
f(x)= (x^(3/2)+3-x^2)^(1/2);
g(x)= -(x^(3/2)+3-x^2)^(1/2);
sol=double(solve(f==0));
sol=sol(sol==real(sol));
disp(sol)
2.7493
Area=2*int(f,0,sol);
disp(['Area under the curve f(x) is: ',char(Area)]);
Area under the curve f(x) is: 2*int((x^(3/2) - x^2 + 3)^(1/2), x, 0, 3095424455315773/1125899906842624)
vol=int(pi*(f)^2,x,a,sol);
Unrecognized function or variable 'a'.
disp(['volume of solid of rotation formed by the curve f(x) and g(x) about x axis is: ',char(vol)]);
%```
sol=sol(sol==real(sol)) %, this part will remove any imaginary terms stored in sol.
output:
>> DA2_Q1_b
2.749289201023484
Area under the curve f(x) is: 2*int((x^(3/2) - x^2 + 3)^(1/2), x, 0, 3095424455315773/1125899906842624)
volume of solid of rotation formed by the curve f(x) and g(x) about x axis is: (3095424455315773*pi*(623191256382180861935616*3095424455315773^(1/2) + 9136014217435573277565931304275))/21408715390589398215874289541742427045741199360
as you can see the output for area is not what i wanted. Can anyone please help me to get a numeric or symbolic answer to area.

1 Comment

Maple is able to produce an exact solution for
2*int((x^(3/2) - x^2 + 3)^(1/2), x, 0, 3095424455315773/1125899906842624)
However, it is a long expression that involves a lot of occurances of expressions similar to
(RootOf(_Z^4 - _Z^3 - 3, index = 1) - RootOf(_Z^4 - _Z^3 - 3, index = 2))*RootOf(_Z^4 - _Z^3 - 3, index = 4)/((RootOf(_Z^4 - _Z^3 - 3, index = 1) - RootOf(_Z^4 - _Z^3 - 3, index = 4))*RootOf(_Z^4 - _Z^3 - 3, index = 2))
Those can be converted to closed form radicals, but then the expressions involve a lot of things such as
(-2*(12 + 4*sqrt(265))^(2/3) + (12 + 4*sqrt(265))^(1/3) + 32)/(12 + 4*sqrt(265))^(1/3)
You can get an exact solution using Maple, but it is a pretty messy exact solution -- the kind of solution that reading it leaves you less enlightened than not reading it.

Sign in to comment.

 Accepted Answer

Torsten
Torsten on 4 Oct 2024
Edited: Torsten on 4 Oct 2024
"int" cannot find an analytical antiderivative for f(x).
Thus to get the numerical value for the integral, use
Area=2*vpaintegral(f,0,sol);
instead of
Area=2*int(f,0,sol);

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Release

R2024b

Community Treasure Hunt

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

Start Hunting!