Evaluating Integrals with Matlab for Integration of (sinx)^(y-3)

In summary, the conversation is about finding a way to evaluate the integral \int(sinx)^{y-3} dx using Matlab. The person attempted to define the variables and use the int function but received a warning stating the explicit integral could not be found. They then asked for help in finding the integral, mentioning that y is a constant and they want the answer in terms of y. They also mentioned trying integration by parts but it did not work and they are now looking for a solution using Matlab.
  • #1
sara_87
763
0

Homework Statement



If i want to evaluate the following integral:
[tex]\int(sinx)^{y-3} dx[/tex]

using Matlab.

Homework Equations





The Attempt at a Solution



i first defined the variables x and y:
syms x
syms y
then i typed the integral;
int(sin(x)^(3-y),x)
but it doesn't give me the integral, it says:
Warning: Explicit integral could not be found.
why?
 
Physics news on Phys.org
  • #2
You may want to refer to this thread:
https://www.physicsforums.com/showthread.php?t=229516

EDIT: Also, are you sure that y (as a variable, and not as a constant defined elsewhere) is supposed to be in your equation? You'll need to solve a differential equation, if that is the case.
 
  • #3
y is a constant but we are not given the value so the answer should be in terms of y.
i want to integrate:
[tex]\frac{(cosy)^{2b-3}}{(siny)^{b-1}}[/tex]
but i don't know how to i tried integration by parts repeatedly but it didnt work
so I am trying to use Matlab.
I did:
syms x
syms y
syms b
int((cos(y))^(2b-3)/((sin(y))^(b-1)),x)
but it didnt work.
do you have any ideas how to find this integral analytically or using Matlab?
 

1. What is Matlab and how does it help with evaluating integrals?

Matlab is a high-level programming language and software environment used for technical computing. It has built-in functions and tools that make it easier to solve mathematical problems, including evaluating integrals. It provides a user-friendly interface and robust algorithms that can handle complex integrals with ease.

2. How do I input the function (sinx)^(y-3) into Matlab for integration?

To input this function into Matlab, you can use the "syms" command to declare the variables x and y as symbolic. Then, you can use the "int" command to integrate the function. For example, if the function is f(x,y) = (sinx)^(y-3), you can input the following code: syms x y; f = (sin(x))^(y-3); int(f,x)

3. Can Matlab handle integration of (sinx)^(y-3) for any value of y?

Yes, Matlab can handle the integration of (sinx)^(y-3) for any value of y. However, keep in mind that the resulting integral may not be expressible in terms of elementary functions for certain values of y. In these cases, Matlab will provide a numerical approximation of the integral.

4. How do I evaluate the integral of (sinx)^(y-3) over a specific interval in Matlab?

You can use the "int" command with the limits of integration specified as the second and third arguments. For example, to evaluate the integral of (sinx)^(y-3) from 0 to pi/2, you can input the code: int(f,x,0,pi/2)

5. Can I use Matlab to find the antiderivative of (sinx)^(y-3)?

Yes, you can use the "int" command to find the antiderivative (or indefinite integral) of (sinx)^(y-3). The resulting expression will depend on the value of y and may not be expressible in terms of elementary functions for certain values of y.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
875
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
340
  • Calculus and Beyond Homework Help
Replies
6
Views
546
  • Calculus and Beyond Homework Help
Replies
7
Views
678
  • Calculus and Beyond Homework Help
Replies
7
Views
699
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
734
  • Calculus and Beyond Homework Help
Replies
10
Views
429
Back
Top