Root solving an integral of an exponential function

syms x
fun = @(t) exp(t.^2)-1/t;
f=int(fun,0,x)
eqn= f==0.1
what root solving function would i use to solve this? It is said it has a root around x=0.5

1 Comment

In general, you could use fzero or vpasolve, but the integral of the function as you've written it will always be , so there must be a typo somewhere.
syms x t
int(exp(t.^2)-1/t,0,x)
ans = 

Sign in to comment.

Answers (1)

Perhaps this is what you meant,
syms x t
fun = (exp(t.^2)-1)/t;
f=matlabFunction( int(fun,0,x) - 0.1 );
x=fzero(f,0.5)
x = 0.4365

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Products

Release

R2019a

Asked:

on 24 May 2021

Edited:

on 25 May 2021

Community Treasure Hunt

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

Start Hunting!