#factors of 6a^2 + 3ac
print ('6*a^2+3*a*c ')
print('=> 3a(2a+c)')
#5*x^2*y^2-10*x^2*y+20*y^2
print"\n the highest common factor to each term is 5 and other factor is y \n"
print('5y(x^2y-2x^2+4y)')
#factors of a^2+cd+ad+ac
print(" \n (a^2+ac)+(ad+cd) => a(a+c)+d(a+d) \n")
print("the factors are:")
print('(a+c)(a+d)')
#factorize, if possible,ab+ac+bc+bd
print("\n there are no factors of this expression")
#factors of ab-5a-3b+15
#by arrangement into suitable pairs,
print("(ab-5a)-(3b-15) => a(b-5)-3(b-5)")
print("\n the factors are: \n")
print('(b-5)(a-3)')
#x^2+13*x+36
import numpy
#x^2+13*x+36;
p=numpy.array([1, 13, 36])
x=numpy.roots(p)
print x
#x^2-13*x+36
import numpy
p=numpy.array([1, -13, 36])
x=numpy.roots(p)
print x
#y^2-13*y+30
import numpy
p=numpy.array([1, -13, 30]);
y=numpy.roots(p)
print y
#x^2-5*x-36
import numpy
p=numpy.array([1, -5, -36])
x=numpy.roots(p)
print x
#x^2+12*x-28
import numpy
p=numpy.array([1, 12, -28])
x=numpy.roots(p)
print x
#a^2-8*a*b-48*b^2
import numpy
p=numpy.array([1, -8, 48])
x=numpy.roots(p)
print x
print "the second letter b will appear in 1st term of each factor"
print "ans(1)=(4b+a)";
print "ans(2)=(-12b+a)"
#2*x^2+7*x+3
import numpy
p=numpy.array([2, 7, 3])
x=numpy.roots(p)
print(x,"the factors of 2*x^2+7*x+3 are")
#6*x^2+17*x-3
import numpy
p=numpy.array([6, 17, -3])
x=numpy.roots(p)
#multiply by 6 the p1 factors to get the original factors of p
print "the factors of 6*x^2+17*x-3 are",x
#4*x^2-17*x-15
import numpy
p=numpy.array([4, -17, -15])
x=numpy.roots(p)
print x,"the factors of 4*x^2-17*x-15 are"
#100*x^2-1
import numpy
p=numpy.array([100, 0, -1])
x=numpy.roots(p)
print x,"is the complete square of binomial"
#36*a^2*b^2-25
#the numbers squared are 6ab and 5")
print ("36*a^2*b^2-25=(6ab+5)(6ab-5)")
#factorize (a+b)^2 - c^2
#using the formula, a^2-b^2=(a+b)(a-b)
print ('(a+b+c)(a+b-c)')
#factorize (a+b)^2 - (c-a)^2
#using the formula, a^2-b^2=(a+b)(a-b)
print ('(b+c)(2a+b-c)')
print 47.5**2-22.5**2
#area of ring between 2 concentric circles.
#given,r1=97mm,r2=83mm
r1=97;r2=83;
#the area of ring is difference between the areas of 2 circles
diff_in_area=(r1**2-r2**2);
print"difference in area=pi mm**2",diff_in_area