My code is giving only one solution to a function although there are two solutions, what can I do to get all the solutions?
7 views (last 30 days)
Jeyamahendran Nithuran on 15 Jun 2022
f(t) = 1.4*exp(0.5*x)-2*x-3 = 0 is the function I tried to solve. Here the variable t indicates time. From plotting the graph I know that there are two roots, one is positive and the other negative. But my code is giving only the negative root which I actually don't need. What should I do to get both the roots?
y2 = 1.4*exp(0.5*x)-2*x-3;
g = y2 == 0;
roots = vpa(solve(y2,x))