# Matlab Symbolic Math Toolbox

1. Sep 12, 2011

### aperception

Does anybody know much about how this works?

I can't understand why it doesn't give me an answer for definite integrals sometimes... e.g. in Matlab R2011a:

syms x a;
int(x/sqrt(x^2+a^2))

gives the answer (a^2 + x^2)^(1/2) as expected.

But int(x/sqrt(x^2+a^2),0,10) gives - Warning: Explicit integral could not be found.

This doesn't really make any sense as the answer should be (a^2 + 10^2)^(1/2) - a. Is there some way to understand this strange behavior?

2. Sep 12, 2011

In this case you have to assume that a is real. Even then the solution will be plus/minus a given that we dont know the sign of a.

evalin(symengine,'assume(a in R_)')
syms x a
int(x/sqrt(x^2+a^2),0,10);

ans =

(a^2 + 100)^(1/2) - abs(a)

3. Sep 12, 2011

### aperception

Ah, thank you! I understand!

4. Sep 12, 2011

### jhae2.718

Another way to declare a real (the code below will actually declare both x and a real, but the example stands) is:
Code (Text):

syms [COLOR="Magenta"]x a real[/COLOR]

I find it easier to remember that way.

5. Sep 12, 2011

### aperception

that's perfect, thank you!

6. Sep 12, 2011