MATLAB Answers

0

Problem with indefinite integral

Asked by PUNIT OJHA on 23 Aug 2019 at 20:28
Latest activity Answered by Walter Roberson
on 23 Aug 2019 at 21:11
why does the indefinite integral shows incorrect result??
how to get the constant term lost back??

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 23 Aug 2019 at 21:11

TIPS
  • Results returned by int do not include integration constants.
If you need a constant of integration, then add one yourself.
"why does the indefinite integral shows incorrect result??"
What leads you to say that the results are wrong?
>> int(2*sin(t)+3*cos(t))
ans =
6*cos(t/2)*sin(t/2) - 4*cos(t/2)^2
>> diff(ans,t)
ans =
3*cos(t/2)^2 - 3*sin(t/2)^2 + 4*cos(t/2)*sin(t/2)
>> simplify(ans)
ans =
3*cos(t) + 2*sin(t)
Looks consistent to me.

  0 Comments

Sign in to comment.