How to calculate indefinite integral?
Afficher commentaires plus anciens
Hello, I hope you den help me. I am doing my math homework and I want to check the answer in Matlab. However, I checked that the answer, that is given by Matlab, is wrong. Here is an example of what I wrote:
>> syms x >> int(sin(2*x-3), x) >> ans = sin(x-3/2)^2
But the correct answer is -cos(3-2x)/2 + C So maybe you can tell me what I do wrong because I am new in Matlab so it is quite hard. Thank you very much for your help!
Best regards, Don
Réponses (2)
Brendan Hamm
le 3 Mar 2015
Modifié(e) : Brendan Hamm
le 4 Mar 2015
1 vote
First off the answer is -cos(2*x-3)/2 + C. The two statements are equivalent up to a constant. Using the half angle identity:
sin(u)^2 = 1/2 - 1/2*cos(2*u)
let u = x -3/2
sin(x-3/2)^2 + C = 1/2 - 1/2*cos(2*(x-3/2)) + C
sin(x-3/2)^2 + C = -1/2*cos(2*x-3) + D
Sean de Wolski
le 4 Mar 2015
Both answers are right, just simplified differently:
syms x
mupad_answer = int(sin(2*x-3), x)
your_answer = -cos(3-2*x)/2;
isequal(simplify(diff(your_answer)),simplify(diff(mupad_answer)))
Catégories
En savoir plus sur Assumptions dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!