function P1Solve()
% Plots the function f(x) = sin(alpha*x) - x for various alpha
close all
for alpha = [.5 1:20]
    x = linspace(-1,1,200);
    y = f(x,alpha);
    plot(x,y,[-1 1],[0 0],'r')
    title(sprintf('f(x) = sin(alpha*x) - x ,  alpha = %1d',alpha),'fontsize',16)
    grid on
    hold on
    z = FindZeros(alpha);
    % Display the roots in the current figure...
    for j=1:length(z)
       plot(z(j),0,'.b','Markersize',20)
    end
    hold off
    shg
    pause
end
clc
fprintf(' Roots of f(x) = sin(20*x) - x\n\n')
for k=1:length(z)
    fprintf('%20.15f\n',z(k))
end

function y = f(x,alpha)
y = sin(alpha*x) - x;