Trouble with symbolic integrals

5 views (last 30 days)
Pedro Jesús Arrabalin Vega
Answered: Star Strider on 22 Oct 2021
syms x;
f = exp((x^2-1)/2)/(1-x^2)^0.5;
int(f,-1,1)
%% Matlab does not solve that integral
% The output is:
% ans =
% int(exp(x^2/2 - 1/2)/(1 - x^2)^(1/2), x, -1, 1)

Answers (1)

Star Strider
Star Strider on 22 Oct 2021
Since the desired result is numeric, use vpaintegral
syms x;
f = exp((x^2-1)/2)/(1-x^2)^0.5;
int_f = vpaintegral(f,-1,1)
int_f = 
2.48505
.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!