Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Symbolic Integration of Linear Function

Subject: Symbolic Integration of Linear Function

From: Ben

Date: 27 Oct, 2012 21:15:08

Message: 1 of 2

I have been using symbolic integration for some time and just discovered what I think is a bug in the routine. I am using MATLAB R2010a and the problem is as follows:

syms x
Vy = 250 - x;
int(Vy)

which returns

-(x - 250)^2/2

rather than

250x - 1/2x^2 as would be expected.

Has anyone else encountered this problem? If so, is there a work around? I can't figure it out because higher order polynoimals integrate just fine.

Thank you is advance,
Ben

Subject: Symbolic Integration of Linear Function

From: Roger Stafford

Date: 27 Oct, 2012 21:52:08

Message: 2 of 2

"Ben" wrote in message <k6hiss$naa$1@newscl01ah.mathworks.com>...
> syms x
> Vy = 250 - x;
> int(Vy)
>
> which returns
>
> -(x - 250)^2/2
>
> rather than
>
> 250x - 1/2x^2 as would be expected.
- - - - - - - - - -
  The 'int' function without any limits on the variable of integration will give the indefinite integral of the integrand, which is arbitrary up to an added constant. The answer you got differs from the answer you expected only by a constant. Therefore this is not a bug but one of infinitely many possible correct answers.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us