question on int and constant of integration

hello everyone, I am a rookie, so apologies in advance if the question is stupid:
int(-2*x/(1 + x^2)^2) gives an answer without a constant
but
int(2*x+9) gives as answer (2*x+9)^2/4 ie with a constant of integration set at 81/4
This is very puzzling. Am I missing anything?

 Accepted Answer

EDIT
Read Roger's reply here:

4 Comments

Why the answer to the int(2*x+9) isn't
x^2 + 9*x
The expanded answer of what you have (and I get also) is
x^2 + 9*x + 81/4 and so it includes the constant 81/4
Of course any answer x^2 + 9*x + C is an integrand of 2*x + 9 (where C is any constant), but why do we get C=81/4 in the second indefinite tegral and C=0 in the first indefinite integral?
expand(int('2*x+9',x))
ans =
x^2 + 9*x + 81/4
Yes, you are right - that is poorly documented at best.
So, according to Roger's reply we have to give int some leeway to add whatever constant it feels like...hmmmm.....And if I want to use int as part of a bigger algorithm where constant has to be determined in a way that satisfies a more complicated set of conditions then what?...
Thanks for your answer .... at least I am reassured now that I still remember how to integrate!
It's been 10 years since Miltos' post, but I'm having the same issue with int() today. The page referenced in the answer is no longer active. Does anyone have an update on this? Thank you in advance.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!