You properly computed the discriminant to be $-3-4 i$. Now, what you need it to compute the square root of this number, that is to say to find a complex number $x=a+i b$ such that $x^2=-3-4i$.
So, develop $$x^2=(a+i b)^2=a^2+2a i b -b^2$$ and identify the real and imaginary parts. This gives you $$a^2-b^2=-3$$ $$2 a b = -4$$ Extract $b=- \frac {2}{a}$ from the last equation and replace in the first. This gives you $$a^2-\frac {4}{a^2}=-3$$ you can easily transform in a quadratic equation in $a^2$. Fortunately, you have the obvious solution $a=1$ and then $b=-2$. So $$\sqrt {-3-4i}=1-2i$$
I am sure that you can take from here and finish your problem.
Here is a cubic-spline interpolation for the $4$ points given in your question:
$
f(x)=
\begin{cases}
+0.1 \overline3(x-3.0)^3 -1.3 (x-3.0)+2.5 & \text{$3.0 \leq x \leq 4.5$}\\
-0.15\overline1(x-4.5)^3+0.6 (x-4.5)^2+0.0\overline4(x-4.5)+1.0 & \text{$4.5 \leq x \leq 7.0$}\\
+0.0 \overline8(x-7.0)^3-0.5\overline3(x-7.0)^2-0.2\overline8(x-7.0)+2.5 & \text{$7.0 \leq x \leq 9.0$}\\
\end{cases}
$
Here is a piece of C code for any given number of points $(x_0,y_0),(x_1,y_1),\ldots,(x_N,y_N)$:
void Spline(double x[N+1],double y[N+1], // input
double A[N],double B[N], // output
double C[N],double D[N]) // output
{
double w[N];
double h[N];
double ftt[N+1];
for (int i=0; i<N; i++)
{
w[i] = (x[i+1]-x[i]);
h[i] = (y[i+1]-y[i])/w[i];
}
ftt[0] = 0;
for (int i=0; i<N-1; i++)
ftt[i+1] = 3*(h[i+1]-h[i])/(w[i+1]+w[i]);
ftt[N] = 0;
for (int i=0; i<N; i++)
{
A[i] = (ftt[i+1]-ftt[i])/(6*w[i]);
B[i] = ftt[i]/2;
C[i] = h[i]-w[i]*(ftt[i+1]+2*ftt[i])/6;
D[i] = y[i];
}
}
void PrintSpline(double x[N+1], // input
double A[N],double B[N], // input
double C[N],double D[N]) // input
{
for (int i=0; i<N; i++)
{
printf("%f <= x <= %f : f(x) = ",x[i],x[i+1]);
printf("%f(x-%f)^3 + ",A[i],x[i]);
printf("%f(x-%f)^2 + ",B[i],x[i]);
printf("%f(x-%f) + " ,C[i],x[i]);
printf("%f\n" ,D[i]);
}
}
Here is a piece of Python code for any given number of points $(x_0,y_0),(x_1,y_1),\ldots,(x_N,y_N)$:
class Point:
def __init__(self,x,y):
self.x = 1.0*x
self.y = 1.0*y
def Spline(points):
N = len(points)-1
w = [(points[i+1].x-points[i].x) for i in range(0,N)]
h = [(points[i+1].y-points[i].y)/w[i] for i in range(0,N)]
ftt = [0]+[3*(h[i+1]-h[i])/(w[i+1]+w[i]) for i in range(0,N-1)]+[0]
A = [(ftt[i+1]-ftt[i])/(6*w[i]) for i in range(0,N)]
B = [ftt[i]/2 for i in range(0,N)]
C = [h[i]-w[i]*(ftt[i+1]+2*ftt[i])/6 for i in range(0,N)]
D = [points[i].y for i in range(0,N)]
return A,B,C,D
def PrintSpline(points,A,B,C,D):
for i in range(0,len(points)-1):
func = str(points[i].x)+' <= x <= '+str(points[i+1].x)+' : f(x) = '
components = []
if A[i]:
components.append(str(A[i])+'(x-'+str(points[i].x)+')^3')
if B[i]:
components.append(str(B[i])+'(x-'+str(points[i].x)+')^2')
if C[i]:
components.append(str(C[i])+'(x-'+str(points[i].x)+')')
if D[i]:
components.append(str(D[i]))
if components:
func += components[0]
for i in range (1,len(components)):
if components[i][0] == '-':
func += ' - '+components[i][1:]
else:
func += ' + '+components[i]
print func
else:
print func+'0'
def Example():
points = [Point(3.0,2.5),Point(4.5,1.0),Point(7.0,2.5),Point(9.0,0.5)]
A,B,C,D = Spline(points)
PrintSpline(points,A,B,C,D)
Please note that the two pieces of code above assume $x_0 < x_1 < \ldots < x_N$.
Best Answer
Hint: if $\,c=0\,$ then the equation reduces to a trivial linear one. Otherwise take the conjugate:
$$ \begin{cases} az = b + c z \bar{z} \\ \bar a \bar z = \bar b + \bar c \bar z z \end{cases} $$
Multiply the first equation by $\bar c$, the second one by $c$ and subtract so that the $z \bar z$ terms cancel out:
$$\require{cancel} a \bar c z - \bar a c \bar z = b \bar c - \bar b c + \cancel{c \bar c z \bar z} - \cancel{\bar c c \bar z z} $$
Other than the trivial case $ac=0\,$, the above gives $\bar z = \cfrac{a \bar c z - b \bar c + \bar b c}{\bar a c}\,$, then substituting $\bar z$ back into the original equation gives a plain quadratic in $z\,$.