Thank you for reading this question.
I'm studying numerical methods and I'm using Matlab for the practical parts.
The problem:
I'm supposed to find 2 different roots, y = 0, for positive x, x > 0, with the function below. When I plot it in Matlab I can only see 1. I've checked and changed my code countless times but for the life of me I can't see what I'm doing wrong. Please help, it would be greatly appreciated. Thank you.
To clarify, I'm not asking for help with an algorithm, I only need help with what I'm doing wrong with inputing the function in Matlab. Again, I can only see it having 1 root, y = 0, and not 2, which is the start of the actual problem I am to solve.
The function: $$ f(x) = 98x - \biggl(\frac{x^2 + x + 0.2}{x + 1}\biggr)^9 + 5xe^{-x} = 0 $$
Here is my Matlab code:
x = 0:0.001:1000;
y = 98.*x - ((x.^2 + x + 0.2)./(x + 1)).^9 + 5.*x.*exp(-x);
What am I doing wrong?
Thank you, regards / euro
If we consider the function $$f(x) = 98x - \biggl(\frac{x^2 + x +\frac 15}{x + 1}\biggr)^9 + 5xe^{-x} $$ $$f(0)=-\frac{1}{1953125}$$ and more than likely a very small root can exist.
Expanding as a Taylor series, we have $$f(x)=-\frac{1}{1953125}+\frac{201171839 }{1953125}x+O\left(x^2\right)$$ Ignoring the higher order terms, then a solution $$x_{est}=\frac{1}{201171839}\approx 4.97087\times 10^{-9}$$