summaryrefslogtreecommitdiff
path: root/964/CH4/EX4.3
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /964/CH4/EX4.3
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '964/CH4/EX4.3')
-rwxr-xr-x964/CH4/EX4.3/4_3.sce25
1 files changed, 25 insertions, 0 deletions
diff --git a/964/CH4/EX4.3/4_3.sce b/964/CH4/EX4.3/4_3.sce
new file mode 100755
index 000000000..40e49d44b
--- /dev/null
+++ b/964/CH4/EX4.3/4_3.sce
@@ -0,0 +1,25 @@
+clc;
+clear;
+m=input("Input value of m:")
+h=input("Input value of h:")
+function y=f(x)
+ y=x^m
+endfunction
+x1=1;
+x2=x1+h;
+fx1=f(x1);
+fx2=fx1+m*(fx1^(m-1))*h;
+if m==1 then
+ R=0;
+else if m==2 then
+ R=2*(h^2)/factorial(2);
+ end
+ if m==3 then
+ R=(6*(x1)*(h^2)/factorial(2))+(6*(h^3)/factorial(3));
+ end
+ if m==4 then
+ R=(12*(x1^2)*(h^2)/factorial(2))+(24*(x1)*(h^3)/factorial(3))+(24*(h^4)/factorial(4));
+ end
+end
+disp(R,"Remainder:",fx2,"The value by first order approximation:")
+disp(f(x2),"True Value at x2:") \ No newline at end of file