Why Does MATLAB's Symbolic Math Toolbox Struggle with Some Definite Integrals?

  • MATLAB
  • Thread starter aperception
  • Start date
  • Tags
    Matlab
In summary, the conversation discusses the issue of definite integrals not giving the expected answer when using MATLAB R2011a. It is suggested to assume that a is real and the solution will be plus/minus a, given that the sign of a is unknown. Another method of declaring a real is also mentioned. The conversation ends with a thank you and a recommendation to consult the MATLAB documentation on the topic.
  • #1
aperception
12
0
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?
 
Physics news on Phys.org
  • #2
In this case you have to assume that a is real. Even then the solution will be plus/minus a given that we don't 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
Ah, thank you! I understand!
 
  • #4
Another way to declare a real (the code below will actually declare both x and a real, but the example stands) is:
Code:
syms [COLOR="Magenta"]x a real[/COLOR]

I find it easier to remember that way.
 
  • #5
that's perfect, thank you!
 

1. What is the Matlab Symbolic Math Toolbox?

The Matlab Symbolic Math Toolbox is a software tool designed for performing symbolic mathematical computations using the Matlab programming language. It provides a set of functions and tools for solving, manipulating, and visualizing symbolic expressions, equations, and functions.

2. What are the benefits of using the Matlab Symbolic Math Toolbox?

Using the Matlab Symbolic Math Toolbox allows for more accurate and precise mathematical computations compared to traditional numerical methods. It also allows for the manipulation and simplification of complex expressions, making it easier to solve and analyze mathematical problems.

3. Can I use the Matlab Symbolic Math Toolbox for solving differential equations?

Yes, the Matlab Symbolic Math Toolbox has a built-in function called "dsolve" that can be used for solving ordinary and partial differential equations symbolically.

4. Are there any limitations to using the Matlab Symbolic Math Toolbox?

While the Matlab Symbolic Math Toolbox is a powerful tool, it does have some limitations. It may not be as efficient for large-scale computations compared to numerical methods, and it may not be able to solve certain types of equations or expressions.

5. Can I use the Matlab Symbolic Math Toolbox for educational purposes?

Yes, the Matlab Symbolic Math Toolbox can be a useful tool for teaching and learning mathematical concepts, equations, and functions. It allows for interactive exploration and visualization of mathematical concepts, making it a valuable tool for educational purposes.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
27
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
4K
  • Calculus and Beyond Homework Help
Replies
20
Views
457
  • Calculus
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top