The perfect square
Let's highlight the perfect square of the square three-member
$$\left(- q^{4} - 4 q^{2}\right) + 5$$
To do this, let's use the formula
$$a q^{4} + b q^{2} + c = a \left(m + q^{2}\right)^{2} + n$$
where
$$m = \frac{b}{2 a}$$
$$n = \frac{4 a c - b^{2}}{4 a}$$
In this case
$$a = -1$$
$$b = -4$$
$$c = 5$$
Then
$$m = 2$$
$$n = 9$$
So,
$$9 - \left(q^{2} + 2\right)^{2}$$
General simplification
[src]
$$- q^{4} - 4 q^{2} + 5$$
/ ___\ / ___\
(q + 1)*(q - 1)*\q + I*\/ 5 /*\q - I*\/ 5 /
$$\left(q - 1\right) \left(q + 1\right) \left(q + \sqrt{5} i\right) \left(q - \sqrt{5} i\right)$$
(((q + 1)*(q - 1))*(q + i*sqrt(5)))*(q - i*sqrt(5))
$$- q^{4} - 4 q^{2} + 5$$
Assemble expression
[src]
$$- q^{4} - 4 q^{2} + 5$$
Rational denominator
[src]
$$- q^{4} - 4 q^{2} + 5$$
Combining rational expressions
[src]
$$q^{2} \left(- q^{2} - 4\right) + 5$$
$$- q^{4} - 4 q^{2} + 5$$
/ 2\
-(1 + q)*(-1 + q)*\5 + q /
$$- \left(q - 1\right) \left(q + 1\right) \left(q^{2} + 5\right)$$
-(1 + q)*(-1 + q)*(5 + q^2)
$$- q^{4} - 4 q^{2} + 5$$