# New solving cubic and quartic equations

1. Nov 6, 2009

### sdio

Cubic equation $$f=a x+b x^2+c x^3$$

Solving:

$$A=\frac{-(a b+9 c f)+\sqrt{(a b+9 c f)^2-4 \left(b^2-3 a c\right) \left(a^2+3 b f\right)}}{2 \left(b^2-3 a c\right)}$$
$$G=a+2 b A+3 c A^2$$
$$H=a A+b A^2+c A^3-f$$
$$F=G^3-27cH^2$$
$$B=\left\{F^{1/3}\,,-(-1)^{1/3} F^{1/3}\,,(-1)^{2/3}F^{1/3}\right\}$$
$$x=A+\frac{3H}{B-G}$$

TeX code for check in your CAS:
Code (Text):
f=a x+b x^2+c x^3\\\\A=\frac{-(a b+9 c f)+\sqrt{(a b+9 c f)^2-4 \left(b^2-3 a c\right) \left(a^2+3 b f\right)}}{2 \left(b^2-3 a c\right)}\\G=a+2 b A+3 c A^2\\H=a A+b A^2+c A^3-f\\F=G^3-27cH^2\\B=\left\{F^{1/3}\,,-(-1)^{1/3} F^{1/3}\,,(-1)^{2/3}F^{1/3}\right\}\\x=A+\frac{3H}{B-G}

Quartic equation $$t=p y+q y^2+r y^3+s y^4$$

Solving:

$$m=3r^2-8 q s$$
$$n=r^3-16 p s^2$$
$$c=(r m-n)/2$$
$$b=3c r+q s\left(r^2-m\right)-4s^2(p r-8s t)$$
$$a=b r-2 c q s$$
$$f=-c r\left(r^2-2 q s\right)-8 s^3\left(p^2 s+r^2t\right)$$
$$A=\frac{-(a b+9 c f)\pm\sqrt{(a b+9 c f)^2-4 \left(b^2-3 a c\right) \left(a^2+3 b f\right)}}{2 \left(b^2-3 a c\right)}$$
$$G=a+2b A+3 c A^2$$
$$H=a A+b A^2+c A^3-f$$
$$F=G^3-27c H^2$$
$$B=F^{1/3}$$
$$X=A+\frac{3H}{B-G}$$
$$u=-4 s^2\left(q^2-2 p r +4 s t\right)-(3 c+m X)(r+X)$$
$$V_0=c r\left(q s\left(r^2+m\right)-r \left(m r+8p s^2\right)\right)+16 s^3 \left(q^4 s-2 r^4 t-4 p q s (q r-2 p s)+8 s^2 t \left(q^2+2 s t\right)\right)$$
$$V_1=c m r^2-2 q s \left(r^5-q s(c+m r)\right)+4 s^2 \left(q^2 r^3+p r \left(r^3+4 p s^2\right)+8 s t\left(2 r^3-3 q r s+2 p s^2\right)\right)$$
$$V_2=-3 c m r-4 s^2 \left(m \left(q^2+2 p r+4 s t\right)+4 r \left(-q^2 r+8 p q s+12 r s t\right)\right)$$
$$V_3=-c(m+4 q s)+2r s\left( q r^2-10 p r s-64 s^2t\right)$$
$$V_4=-3c r+4s\left( q r^2-10 p r s-64 s^2t\right)$$
$$v=V_0-4V_1 X+2V_2 X^2+4V_3 X^3+V_4 X^4$$
$$w=\pm\sqrt{-u\pm\sqrt{u^2-v}}$$
$$z=w-2 q s+r^2+r X+X^2$$
$$y=\frac{X\pm\sqrt{z}}{2s}$$

TeX code:
Code (Text):
t=p y+q y^2+r y^3+s y^4\\\\m=3r^2-8 q s\\n=r^3-16 p s^2\\c=(r m-n)/2\\b=3c r+q s\left(r^2-m\right)-4s^2(p r-8s t)\\a=b r-2 c q s\\f=-c r\left(r^2-2 q s\right)-8 s^3\left(p^2 s+r^2t\right)\\A=\frac{-(a b+9 c f)\pm\sqrt{(a b+9 c f)^2-4 \left(b^2-3 a c\right) \left(a^2+3 b f\right)}}{2 \left(b^2-3 a c\right)}\\G=a+2b A+3 c A^2\\H=a A+b A^2+c A^3-f\\F=G^3-27c H^2\\B=F^{1/3}\\X=A+\frac{3H}{B-G}\\u=-4 s^2\left(q^2-2 p r +4 s t\right)-(3 c+m X)(r+X)\\V_0=c r\left(q s\left(r^2+m\right)-r \left(m r+8p s^2\right)\right)+16 s^3 \left(q^4 s-2 r^4 t-4 p q s (q r-2 p s)+8 s^2 t \left(q^2+2 s t\right)\right)\\V_1=c m r^2-2 q s \left(r^5-q s(c+m r)\right)+4 s^2 \left(q^2 r^3+p r \left(r^3+4 p s^2\right)+8 s t\left(2 r^3-3 q r s+2 p s^2\right)\right)\\V_2=-3 c m r-4 s^2 \left(m \left(q^2+2 p r+4 s t\right)+4 r \left(-q^2 r+8 p q s+12 r s t\right)\right)\\V_3=-c(m+4 q s)+2r s\left( q r^2-10 p r s-64 s^2t\right)\\V_4=-3c r+4s\left( q r^2-10 p r s-64 s^2t\right)\\v=V_0-4V_1 X+2V_2 X^2+4V_3 X^3+V_4 X^4\\w=\pm\sqrt{-u\pm\sqrt{u^2-v}}\\z=w-2 q s+r^2+r X+X^2\\y=\frac{X\pm\sqrt{z}}{2s}

2. Nov 6, 2009

### rochfor1

Is there a question in there somewhere?