Find the Definite Integral of Arccos Function in Matlab | Integral Problem

In summary, the conversation discusses finding the definite integral of arccos(sqrt(1+x)/10)/(sqrt(x)*x^(2/3)) over the interval [0,pi/2] using Matlab. The speaker shares that they received an error message when running their code and asks for advice. Another person suggests using quadl() instead of int() to evaluate the integral numerically, which resolves the issue.
  • #1
amykelly36
2
0
I want to find the definite integral of

arccos(sqrt(1+x)/10)/(sqrt(x)*x^(2/3))​

,over [0,pi/2].

I ran the following code in Matlab,

"syms w

double(vpa(int(acos((w + 1)^(1/2)/10)/(w^(1/2)*(w + 1)^(3/2)),w,0,pi/2)))"

and got this error message,

"? Error using ==> mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a
double array.

If the input expression contains a symbolic variable, use the VPA function
instead.

Error in ==> sym.sym>sym.double at 936
Xstr = mupadmex('symobj::double', S.s, 0);

Error in ==> HW at 4
double(vpa(int(acos((w + 1)^(1/2)/10)/(w^(1/2)*(w + 1)^(3/2)),w,0,pi/2)))".

Anybody has met such situation like me before? I appreciate any comment!
 
Physics news on Phys.org
  • #2
Hello there! I think that int() cannot be used here, since the integral will need to be evaluated numerically. Try using quadl() instead:

Code:
this = @(w)acos((w+1).^(1/2)/10)./(w.^(1/2).*(w+1).^(3/2)); % note the elementwise operations (.^, ./, .*)

quadl(this,0,pi/2)

Hopefully that helps!
 
  • #3
Thanks a lot! It exactly settles the issue.
 

Related to Find the Definite Integral of Arccos Function in Matlab | Integral Problem

1. What is the purpose of finding the definite integral of arccos function in Matlab?

The purpose of finding the definite integral of arccos function in Matlab is to calculate the area under the curve of the arccos function between two specified limits. This can be useful in solving various mathematical and engineering problems.

2. How do I find the definite integral of arccos function in Matlab?

To find the definite integral of arccos function in Matlab, you can use the 'integral' function. This function takes in the arccos function as the first argument, the lower limit as the second argument, and the upper limit as the third argument. The result will be the value of the definite integral.

3. Can I use the 'integral' function for any arccos function?

Yes, the 'integral' function in Matlab can be used for any arccos function as long as the function is defined within the given limits and is integrable.

4. What if I want to find the indefinite integral of arccos function in Matlab?

To find the indefinite integral of arccos function in Matlab, you can use the 'int' function. This function takes in the arccos function as the first argument and returns the result as a symbolic expression. You can also use the 'int' function to find the indefinite integral of any function in Matlab.

5. Are there any limitations to using Matlab to find the definite integral of arccos function?

Yes, there are some limitations to using Matlab to find the definite integral of arccos function. This includes the inability to handle certain types of integrals, such as those involving infinite limits or discontinuous functions. It is important to check the validity of the integral before using Matlab to find its value.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top