#simplify 5a+6b+2a-3b
#('collecting like terms \n');
x=5+2;y=6-3;
print"total=a+b",x,y
#collecting like terms ;
x=15+7;y=6-3;
print"total=x+y-5",x,y
x_coeff=6-3;y_coeff=2+4;
#"substitue given values"
x=3;y=2;
val=x_coeff*x + y_coeff*y -3
print val
#84a**6/12a**2
import string
A=1;#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convince poly(0,'a');
p1=84*A**6;
p2=12*A**2;
p=p1/p2;
print '84a**6/12a**2'
#3x**4/6x**6
x=('x')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convince poly(0,'a');poly(0,'x');
p1='3*x**4';
p2='6*x**6';
#p=p1/p2
print '3x**4/6x**6'
#x/3 + x/5
x=('x')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convince poly(0,'a');poly(0,'x');poly(0,'x');
p1='x/3';
p2='x/5';
p=p1+p2;
q='8*x/15';
if(p==q):
print"val=8*x/15 \n"
print"val=8*x/15"
#given problem sum of 3/a + 4/b
print"((3b + 4a)/(ab))"
#given problem is x/y - a/b
print'(bx-ay)/(by)'
#2a/15 + 5b/12
d=60#"L.C.M of denominators"
k=d;
a_coeff=60/15*2;
b_coeff=60/12*5;
print'ans='
print"(a+b)/k",a_coeff,b_coeff,k
#x/12a**2b - y/18ab**2
k=36#lcm(d);#L.C.M of denominators
#"L.C.M of a**2*b and a*b**2 is a**2*b**2"
x_coeff=36/12;
y_coeff=36/18;
print'ans='
print"(bx-ay)/a**2b**2",x_coeff,y_coeff,k
#4*x**3*y/(6*x*y**3)
gcd_d=1#GCD of 4 and 6 is 2
m=4/gcd_d
n=6/gcd_d
x=1#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');
y=1#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'y');
p1=x**3;p2=x;p=p1/p2;
q1=y;q2=y**3;q=q1/q2;
#val=m/n*p*q
print'val='
print"/*x**2/y**2",m/2,n/2
#6*a*x**4*2*y**3/(14*x**2*y**2*3*a**4)
x=('x')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');poly(0,'x');
y=('y')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');poly(0,'y');
a=('a')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');poly(0,'a');
num=6.*2./(14.*3.);
p1='x**4';p2='x**2';p='p1/p2';
q1='y**3';q2='y**2';q='q1/q2';
r1='a';r2='a**4';r='r1/r2';
#val=num*p*q*r
print'val='
print"*x**2*y/a**3",num
#(8x**3)/(5a**2y) *(3a)/(4x**2)
x=('x')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');poly(0,'x');
y=('y')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');poly(0,'y');
a=('a')#is polynomial function of degree zero poly(0,'x');#for this I assume it to be 1 for my convincepoly(0,'x');poly(0,'a');
p1='x**3';p2='x**2';p='p1/p2';
q='1/y';
r1='a';r2='a**2';r='r1/r2';
num=8.*3./(5.*4.);
#val=num*p*q*r
print('val=')
print"*x/(a*y)",num