Qno:-1Write a Scilab Code to find the real roots of the equation x3 – x – 1 = 0 using Bisection Method. 
program
deff('y=f(x)','y=x^3-x-1');
x1=1,x2=2;
d=0.0001;
c=1;
disp('successive approximation')
 while abs(x1-x2)>d
    m=(x1+x2)/2;
  disp(x1,x2,m,f(m));
   if f(m)*f(x1)>0
      x1=m;
   else 
       x2=m;
   end
   c=c+1;
   end
disp('The solution of equation after %i itration is %g',c,m);

Qno2:-Write a Scilab Code to find the real roots of the equation 2x3 – x – 5 = 0 using Bisection Method.
program
deff('y=f(x)','y=x^3-2*x-5');
x1=2,x2=3;
d=0.00001;
c=1;
disp('successive approximation')
 while abs(x1-x2)>d
    m=(x1+x2)/2;
  disp(x1,x2,m,f(m));
   if f(m)*f(x1)>0
      x1=m;
   else 
       x2=m;
   end
   c=c+1;
   end
disp('The solution of equation after %i itration is %g',c,m);
Qno3:-Write a Scilab Code to find the real roots of the equation 2x3 – x – 5 = 0 using False Position Method. 
program
deff('y=f(x)','y=x^3-2*x-5');
a=2,b=3;
d=0.00001;
c=1;
disp('successive approximation')
 for i=1.25
x1=b*f(a)/(f(a)-f(b))+a*f(b)/(f(b)-f(a));
if (f(a)*f(x1))>0
b=x1;
else
a=x1;
end
if abs(f(x1))<d
break
end
disp(a,b,f(a),f(b),x1);
end
disp('the root of equation is %f',x1);
Qno6:-Write a Scilab Code to find the real roots of the equation x^6 + x – 1 = 0 using Secant Method.
program
function [x]=secant(a,b,f)
   N=100;
   PE=10^-4
   for n=1:1:N
   x=a-(a-b)*f(a)/(f(a)-f(b));
   if abs(f(x))<=PE then
   break;
   else a=b;
   b=x;
   end
   end
   disp(n,"Number of iterations=");
   endfunction

 deff('[y]=f(x)','y=x^6-x-1');
a=1;
b=2;
secant(a,b,f)
Qno9:-Write and execute Scilab Code for the following ∫ 𝑒
𝑥
1
0
dx, with n = 4. Using Trapezoidal Rule. 
program
function[i]=trapezoidal(a,b,n,f)
   h=(b-a)/n;
   x=(a:h:b);
   y=f(x);
   m=length(y);
   i=y(1)+y(m);
   for j=2:m-1
   i=i+2*y(j);
   end
   i=(h/2)*i;
   return(i);
   endfunction
deff('[y]=f(x)','y=exp(x)')
trapezoidal(0,1,4,f)
Qno.17:-Write and execute Scilab Code for the following. Determine the value of y when x = 0.1, using Runge Kutta 4th order method, given that y(0) = 2 and y’ = y – x, take h = 0.1. (2,2051708)
program
deff('y=f(x,y)','y=y-x')
y=2;x=0;h=0.1;k1=h*f(x,y);k2=h*f(x+h,y+k1);
y1=y+(k1+k2)/2
disp('y(0.1)by second order runge kutta method:%0.4f',y1); 
y=y1;x=0.1;h=0.1;k1=h*f(x,y);
k2=h*f(x+h,y+k1);
y1=y+(k1=k2)/2
y1=y+(k1+k2)/2
disp('y(0.2)by second order runge kutta method:%0.4f',y1);  
y=2,x=0,h=0.1;
k1=h*f(x,y);
k2=h*f(x+h/2,y+k1/2);
k3=h*f(x+h/2,y+k2/2);
k4=h*f(x+h,y+k3);y1=y+(k1+2*k2+2*k3+k4)/6;
disp('y(0.1) by fourth order runge kutta method:%0.4f',y1);
y=y1,x=0.1,h=0.1;k1=h*f(x,y);k2=h*f(x+h/2,y+k1/2); 
k3=h*f(x=h/2,y+k2/2);k4=h*f(x=h,y+k3); 
y1=y+(k1+2*k2+2*k3+k4)/6
disp('\n y(0.1) by fourth order runge kutta method:%0.4f',y1);
 y=2,x=0,h=0.1;