Assign variables in Maple

390 Views Asked by At

I have an equation

$$ y = 2 x+400 $$

Can I with Maple multiply the slope ($\alpha=2$) with a factor $k$ without affecting the intersection ($\beta = 400$)?

Can I eventually let Maple assign $\alpha$ and $\beta$ by letting Maple know that the equation is linear? I mean assignLinear(2*x+400,\alpha,\beta) or something similar, enabling me to multiply $\alpha$ by the factor $k$.

I often need a way to assign the variables in a linear equation. If I, for instance, have $TC = TVC+TFC = 2 \cdot Q+400$, can I easily assign $TVC=2x$ and $TFC=400$?

1

There are 1 best solutions below

0
On

You can extract coefficients of the polynomial with coeff():

> TC:=2*Q+400;
> TVC:=coeff(TC,Q,1)*x; # TVC := 2*x
> TFC:=coeff(TC,Q,0);   # TFC := 400