MATLAB: Solve equation f(x) = sin(x) − x^2 = 0 providing x is not equal 0 solution.

advanced numerical methods

Could you help me to calculate this question?

Best Answer

Plot it first. That will give you an idea of how best to search for at least one non-trivial solution:
f = @(x) sin(x) - x.^2;
x = linspace(-1, 1);
figure
plot(x, f(x))
grid
xs = fzero(f, 1)
produces:
xs =
0.876726215395062
Related Question