Mister Exam

Other calculators

x^2+p*x+q=0 equation

The teacher will be very surprised to see your correct solution 😉

v

Numerical solution:

Do search numerical solution at [, ]

The solution

You have entered [src]
 2              
x  + p*x + q = 0
$$q + \left(p x + x^{2}\right) = 0$$
Detail solution
This equation is of the form
a*x^2 + b*x + c = 0

A quadratic equation can be solved
using the discriminant.
The roots of the quadratic equation:
$$x_{1} = \frac{\sqrt{D} - b}{2 a}$$
$$x_{2} = \frac{- \sqrt{D} - b}{2 a}$$
where D = b^2 - 4*a*c - it is the discriminant.
Because
$$a = 1$$
$$b = p$$
$$c = q$$
, then
D = b^2 - 4 * a * c = 

(p)^2 - 4 * (1) * (q) = p^2 - 4*q

The equation has two roots.
x1 = (-b + sqrt(D)) / (2*a)

x2 = (-b - sqrt(D)) / (2*a)

or
$$x_{1} = - \frac{p}{2} + \frac{\sqrt{p^{2} - 4 q}}{2}$$
$$x_{2} = - \frac{p}{2} - \frac{\sqrt{p^{2} - 4 q}}{2}$$
Vieta's Theorem
it is reduced quadratic equation
$$p x + q + x^{2} = 0$$
where
$$p = \frac{b}{a}$$
True

$$q = \frac{c}{a}$$
True

Vieta Formulas
$$x_{1} + x_{2} = - p$$
$$x_{1} x_{2} = q$$
$$x_{1} + x_{2} = - p$$
$$x_{1} x_{2} = q$$
The graph
Sum and product of roots [src]
sum
            /              ____________________________________________________________                                                                \       ____________________________________________________________                                                                               /              ____________________________________________________________                                                                \       ____________________________________________________________                                                                
            |             /                                                          2     /     /                            2        2             \\|      /                                                          2     /     /                            2        2             \\               |             /                                                          2     /     /                            2        2             \\|      /                                                          2     /     /                            2        2             \\
            |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||   4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/|               |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||   4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/|
            |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||   \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *cos|----------------------------------------------------------|               |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||   \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *cos|----------------------------------------------------------|
  re(p)     |  im(p)                                                                       \                            2                             /|                                                                       \                            2                             /     re(p)     |  im(p)                                                                       \                            2                             /|                                                                       \                            2                             /
- ----- + I*|- ----- - --------------------------------------------------------------------------------------------------------------------------------| - -------------------------------------------------------------------------------------------------------------------------------- + - ----- + I*|- ----- + --------------------------------------------------------------------------------------------------------------------------------| + --------------------------------------------------------------------------------------------------------------------------------
    2       \    2                                                                    2                                                                /                                                                  2                                                                       2       \    2                                                                    2                                                                /                                                                  2                                                                
$$\left(i \left(- \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) - \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \cos{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{re}{\left(p\right)}}{2}\right) + \left(i \left(\frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) + \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \cos{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{re}{\left(p\right)}}{2}\right)$$
=
           /              ____________________________________________________________                                                                \     /              ____________________________________________________________                                                                \
           |             /                                                          2     /     /                            2        2             \\|     |             /                                                          2     /     /                            2        2             \\|
           |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||     |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||
           |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||     |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||
           |  im(p)                                                                       \                            2                             /|     |  im(p)                                                                       \                            2                             /|
-re(p) + I*|- ----- + --------------------------------------------------------------------------------------------------------------------------------| + I*|- ----- - --------------------------------------------------------------------------------------------------------------------------------|
           \    2                                                                    2                                                                /     \    2                                                                    2                                                                /
$$i \left(- \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) + i \left(\frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) - \operatorname{re}{\left(p\right)}$$
product
/            /              ____________________________________________________________                                                                \       ____________________________________________________________                                                                \ /            /              ____________________________________________________________                                                                \       ____________________________________________________________                                                                \
|            |             /                                                          2     /     /                            2        2             \\|      /                                                          2     /     /                            2        2             \\| |            |             /                                                          2     /     /                            2        2             \\|      /                                                          2     /     /                            2        2             \\|
|            |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||   4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/|| |            |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||   4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||
|            |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||   \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *cos|----------------------------------------------------------|| |            |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||   \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *cos|----------------------------------------------------------||
|  re(p)     |  im(p)                                                                       \                            2                             /|                                                                       \                            2                             /| |  re(p)     |  im(p)                                                                       \                            2                             /|                                                                       \                            2                             /|
|- ----- + I*|- ----- - --------------------------------------------------------------------------------------------------------------------------------| - --------------------------------------------------------------------------------------------------------------------------------|*|- ----- + I*|- ----- + --------------------------------------------------------------------------------------------------------------------------------| + --------------------------------------------------------------------------------------------------------------------------------|
\    2       \    2                                                                    2                                                                /                                                                  2                                                                / \    2       \    2                                                                    2                                                                /                                                                  2                                                                /
$$\left(i \left(- \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) - \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \cos{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{re}{\left(p\right)}}{2}\right) \left(i \left(\frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) + \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \cos{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{re}{\left(p\right)}}{2}\right)$$
=
I*im(q) + re(q)
$$\operatorname{re}{\left(q\right)} + i \operatorname{im}{\left(q\right)}$$
i*im(q) + re(q)
Rapid solution [src]
                 /              ____________________________________________________________                                                                \       ____________________________________________________________                                                                
                 |             /                                                          2     /     /                            2        2             \\|      /                                                          2     /     /                            2        2             \\
                 |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||   4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/|
                 |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||   \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *cos|----------------------------------------------------------|
       re(p)     |  im(p)                                                                       \                            2                             /|                                                                       \                            2                             /
x1 = - ----- + I*|- ----- - --------------------------------------------------------------------------------------------------------------------------------| - --------------------------------------------------------------------------------------------------------------------------------
         2       \    2                                                                    2                                                                /                                                                  2                                                                
$$x_{1} = i \left(- \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) - \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \cos{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{re}{\left(p\right)}}{2}$$
                 /              ____________________________________________________________                                                                \       ____________________________________________________________                                                                
                 |             /                                                          2     /     /                            2        2             \\|      /                                                          2     /     /                            2        2             \\
                 |          4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/||   4 /                            2   /  2        2             \      |atan2\-4*im(q) + 2*im(p)*re(p), re (p) - im (p) - 4*re(q)/|
                 |          \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *sin|----------------------------------------------------------||   \/   (-4*im(q) + 2*im(p)*re(p))  + \re (p) - im (p) - 4*re(q)/  *cos|----------------------------------------------------------|
       re(p)     |  im(p)                                                                       \                            2                             /|                                                                       \                            2                             /
x2 = - ----- + I*|- ----- + --------------------------------------------------------------------------------------------------------------------------------| + --------------------------------------------------------------------------------------------------------------------------------
         2       \    2                                                                    2                                                                /                                                                  2                                                                
$$x_{2} = i \left(\frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \sin{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{im}{\left(p\right)}}{2}\right) + \frac{\sqrt[4]{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)}\right)^{2} + \left(\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2}\right)^{2}} \cos{\left(\frac{\operatorname{atan_{2}}{\left(2 \operatorname{re}{\left(p\right)} \operatorname{im}{\left(p\right)} - 4 \operatorname{im}{\left(q\right)},\left(\operatorname{re}{\left(p\right)}\right)^{2} - 4 \operatorname{re}{\left(q\right)} - \left(\operatorname{im}{\left(p\right)}\right)^{2} \right)}}{2} \right)}}{2} - \frac{\operatorname{re}{\left(p\right)}}{2}$$
x2 = i*(((2*re(p)*im(p) - 4*im(q))^2 + (re(p)^2 - 4*re(q) - im(p)^2)^2)^(1/4)*sin(atan2(2*re(p)*im(p) - 4*im(q, re(p)^2 - 4*re(q) - im(p)^2)/2)/2 - im(p)/2) + ((2*re(p)*im(p) - 4*im(q))^2 + (re(p)^2 - 4*re(q) - im(p)^2)^2)^(1/4)*cos(atan2(2*re(p)*im(p) - 4*im(q), re(p)^2 - 4*re(q) - im(p)^2)/2)/2 - re(p)/2)