MATLAB Answers

# solving definite integrals exponential

10 views (last 30 days)
Bradley Johnson on 10 Feb 2020
Answered: Jyothis Gireesh on 13 Feb 2020
im trying to integrate e^(x/2) from -2 to 10 and cant get it to actually solve the integral function instead i get the answer : 2*exp(-1)*(exp(6) - 1).
I entered :
syms x;
f = exp(x./2);
A = int(f, -2,10)

#### 1 Comment

Walter Roberson on 10 Feb 2020
What is wrong with that answer from your viewpoint?

Sign in to comment.

### Accepted Answer

Jyothis Gireesh on 13 Feb 2020
I am assuming that you want to know the reason behind the solution being an analytic expression instead of a numeric answer. According to the documentation on symbolic integral function “int()”, it returns a symbolic expression as output.
To get a numeric answer, you may use the “vpa” function in MATLAB. This function evaluates the symbolic input to 32 significant digits (by default). In addition, it also provides the provision to limit the number of significant digits by taking a second input argument. In this case, the expression evaluates to
vpa(A)
ans =
296.09055932281032219904011254078
Please refer to the following documentation link on “vpa” for any further clarifications.

#### 0 Comments

Sign in to comment.

### More Answers (0)

Sign in to answer this question.