import math
import numpy as np
#Variable Decleration
w=60 #Continous Load in lb/ft
L1=3 #Length in ft
L2=9 #Length in ft
#Calculations
#After carrying out the variable computations we get
A=np.array([[1,1,0,0],[(L1+L2),0,1,1],[0.5*(L1+L2)**2,0,-(L1+L2),0],[6**-1*(L1+L2)**3,0,-0.5*(L1+L2)**2,0]])
B=np.array([w*L2,w*L2*0.5*L2,L2**3*10,L2**4*2.5])
C=np.linalg.solve(A,B)
#Result
print "The values are as follows"
print "Ra=",round(C[0]),"lb Ma=",round(C[2]),"lb.ft Rb=",round(C[1]),"lb and Mb=",round(C[3]),"lb.ft"
#NOTE:The answer for Mb in the textbook is incorrect