How to calculate indefinite integral?

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

回答 (2 件)

Brendan Hamm
Brendan Hamm 2015 年 3 月 3 日
編集済み: Brendan Hamm 2015 年 3 月 4 日

1 投票

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
Sean de Wolski 2015 年 3 月 4 日

0 投票

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)))

タグ

質問済み:

2015 年 3 月 3 日

回答済み:

2015 年 3 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by