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)
Area=2*int(f,0,sol);
disp([‘Area under the curve f(x) is: ‘,char(Area)]);
vol=int(pi*(f)^2,x,a,sol);
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.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)
Area=2*int(f,0,sol);
disp([‘Area under the curve f(x) is: ‘,char(Area)]);
vol=int(pi*(f)^2,x,a,sol);
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. 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)
Area=2*int(f,0,sol);
disp([‘Area under the curve f(x) is: ‘,char(Area)]);
vol=int(pi*(f)^2,x,a,sol);
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. integration, output MATLAB Answers — New Questions