integral does not give results
Show older comments
x=sym('x')
int(((x*exp(-x/3))+tan(x)),0,5)
I can't find where I made the mistake, Matlab does not give results

Answers (1)
Star Strider
on 24 Aug 2020
It works for me (in R2020a):
x=sym('x')
Int = int(x*exp(-x/3)+tan(x),x,0,5)
producing:
Int =
NaN
To understand the results, plot the function:
figure
fplot(x*exp(-x/3)+tan(x), [0,5])
grid
.
7 Comments
Bilal Ates
on 24 Aug 2020
Star Strider
on 24 Aug 2020
That is not the same as in your original Question.
Bilal Ates
on 24 Aug 2020
Star Strider
on 24 Aug 2020
It gives NaN (in R2020a) when evaluated across
. or any other angle x where
.
. syms x
I = int(tan(x), 0, 5)
produces:
I =
NaN
It may give different results in other versions.
.
Bilal Ates
on 24 Aug 2020
Star Strider
on 24 Aug 2020
My pleasure!
Bruno Luong
on 24 Aug 2020
This might be useful
syms x
Int = int(x*exp(-x/3)+tan(x),x,0,5,'PrincipalValue',true)
Categories
Find more on NaNs 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!