This piece of code is inside a function I'm writing. In the last two lines is my problem.
firm1 = quote(q0_1 + c1 * q1 + c1_2 * q1) ## firm 1's cost curve
firm2 = quote(q0_2 + c2 * q2 + c2_2 * q2) ## firm 2's cost curve
q = quote(q1 + q2) #total supply
demand = quote(p_0 + a*q + b * q^2) # market demand curve
mg_cost1 = D(firm1, "q1") #firm 1's marginal cost/ supply curve
mg_cost2 = D(firm2, "q2") # firm 2's marginal cost/ supply curve
profit1 = (mg_cost1*demand) - firm1 #each firm's profit curve
profit2 = (mg_cost2*demand) - firm2
mg_costi
and demand
are quotes (useful to be able to differentiate them without problems), but apparently multiplying quotes is not as simple as multiplying variables. Does anyone know how to do this?