beginner integration trouble.

2 ビュー (過去 30 日間)
Aryaman
Aryaman 2024 年 10 月 4 日
コメント済み: Walter Roberson 2024 年 10 月 5 日
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 件のコメント
Walter Roberson
Walter Roberson 2024 年 10 月 5 日
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.

サインインしてコメントする。

採用された回答

Torsten
Torsten 2024 年 10 月 4 日
編集済み: Torsten 2024 年 10 月 4 日
"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);

その他の回答 (0 件)

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by