-
Notifications
You must be signed in to change notification settings - Fork 0
/
DIFFERENTIATION PROGRAME FOR A QUADRATIC POLYNAMIAL.py
128 lines (124 loc) · 5.33 KB
/
DIFFERENTIATION PROGRAME FOR A QUADRATIC POLYNAMIAL.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
ch='yes'
while(ch=='yes'):
p=input("ENTER THE FUNTION TO BE DIFFERENTIATE:\t")
wrt=input("ENTER THE FUNTION WITH RESPECT TO :\t")
c=int(input("ENTER THE COEFFITIANTE OF X:\t"))
n=int(input("ENTER THE POWER OF THE FUNTION:\t"))
ab=input("DO YOU WANT TO ADD OR SUBRACT ANYTHING ")
if(ab=='yes'):
B=input("ENTER THE BINARY OPERATER TO BE USE")
n1=int(input("ENTER THE POWER OF THE FUNTION:\t"))
c1=int(input("ENTER THE COEFFITIANTE OF X:\t"))
C=input("ENTER THE CONSTANT VALUE FOR THE EQUATION")
if(ab=='yes'):
print("\n\tTHE GIVEN EQUATION IS:\t",c,'*',p,'^',n,B,c1,'*',p,'^',n1,B,C)
else:
print('THE GIVEN EQUATION IS:\t',c,'*',p,'^',n)
if(wrt==p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',n*c,'*',p,'^',n-1,'*','[','d',p,'/','d',wrt,'=',1,']')
elif(wrt==p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',n*c,'*',p,'^',n-1,'*','[','d',p,'/','d',wrt,'=',1,']',B,n1*c1,'*',p,'^',n1-1,'*','[','d',p,'/','d',wrt,'=',1,']')
if(wrt!=p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',n*c,'*',p,'^',n-1,'d',p,'/','d',wrt)
elif(wrt!=p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',n*c,'*',p,'^',n-1,'d',p,'/','d',wrt,B,n1*c1,'*',p,'^',n1-1,'d',p,'/','d',wrt)
o=input("IF YOU WANT TO FIND F''(X)..........")
if(o=='yes'):
x1=n*c
x2=n-1
x3=n-2
if(ab=='yes'):
a1=n1*c1
a2=n1-1
a3=n1-2
if(wrt==p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']')
elif(wrt==p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']',B,a1*a2,'*',p,'^',a3,'*','[','d',p,'/','d',wrt,'=',1,']')
if(wrt!=p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt)
elif(wrt!=p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt,B,a1*a2,'*',p,'^',a3,'d',p,'/','d',wrt)
else:
x1=n*c
x2=n-1
x3=n-2
if(ab=='yes'):
a1=n1*c1
a2=n1-1
a3=n1-2
print("THANKING YOU FOR FOUND F''(X)")
o1=input("IF YOU WANT TO FIND F'''(X).........")
if(o1=='yes'):
x1=x1*x2
x2=n-2
x3=n-3
if(ab=='yes'):
a1=a1*a2
a2=n1-2
a3=n1-3
if(wrt==p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']')
elif(wrt==p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']',B,a1*a2,'*',p,'^',a3,'*','[','d',p,'/','d',wrt,'=',1,']')
if(wrt!=p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt)
elif(wrt!=p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt,B,a1*a2,'*',p,'^',a3,'d',p,'/','d',wrt)
else:
x1=x1*x2
x2=n-2
x3=n-3
if(ab=='yes'):
a1=a1*a2
a2=n1-2
a3=n1-3
print("THANKING YOU FOR FOUND F'''(X)")
o2=input("IF YOU WANT TO FIND F'4(X)..........")
if(o2=='yes'):
x1=x1*x2
x2=n-3
x3=n-4
if(ab=='yes'):
a1=a1*a2
a2=n1-3
a3=n1-4
if(wrt==p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']')
elif(wrt==p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']',B,a1*a2,'*',p,'^',a3,'*','[','d',p,'/','d',wrt,'=',1,']')
if(wrt!=p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt)
elif(wrt!=p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt,B,a1*a2,'*',p,'^',a3,'d',p,'/','d',wrt)
else:
x1=x1*x2
x2=n-3
x3=n-4
if(ab=='yes'):
a1=a1*a2
a2=n1-3
a3=n1-4
print("THANKING YOU FOR FOUND F'4(X)")
o3=input("IF YOU WANT TO FIND F'5(X)..........")
if(o3=='yes'):
x1=x1*x2
x2=n-4
x3=n-5
if(ab=='yes'):
a1=a1*a2
a2=n1-4
a3=n1-5
if(wrt==p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']')
elif(wrt==p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'*','[','d',p,'/','d',wrt,'=',1,']',B,a1*a2,'*',p,'^',a3,'*','[','d',p,'/','d',wrt,'=',1,']')
if(wrt!=p and ab!='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt)
elif(wrt!=p and ab=='yes'):
print('\n\t','d','/','d',wrt,'=',x1*x2,'*',p,'^',x3,'d',p,'/','d',wrt,B,a1*a2,'*',p,'^',a3,'d',p,'/','d',wrt)
else:
print("THANKING YOU FOR FOUND F'5(X)")
ch=input("DO YOU WANT TO FIND THE SOLUTION AGAIN..........")
else:
print('THANKING YOU FOR FINDING ALL SOLUTIONS')