# Performing Differentiation on Complex Functions!

Using method of variation of parameters , solve the following differential equation $$\frac{d^2y}{dx^2}+y=\csc x.$$

I know that, if, the given differential equation is of the form, $$\frac{d^2y}{dx^2}+P\frac{dy}{dx}+Qy=g(x),$$ and the two fundamental solution of $$\frac{d^2y}{dx^2}+P\frac{dy}{dx}+Qy=0,$$ are $$u$$ and $$v$$ then, the particular integral of $$\frac{d^2y}{dx^2}+P\frac{dy}{dx}+Qy=g(x),$$ is given by $$y=-u\int\frac{vg(x)}{w(u,v)}dx +v\int\frac{ug(x)}{w(u,v)}dx\tag 1,$$ where $$w(u,v)$$ is the wronskian of the two functions $$u,v$$ i.e $$w(u,v)=\begin{vmatrix} u & v\\ u'&v'\end{vmatrix}.$$

However, the problem is, in this case, the complementary function, or the fundamental set of solutions of $$\frac{d^2y}{dx^2}+y=0$$ are $$u=e^{ix}$$ and $$v=e^{-ix}.$$

Here, I am experiencing a couple of issues while applying the above mentioned formula $$(1)$$ of particular integrals.

All in all, I have to calculate the wronskian firstly. But then, I have only worked with calculus problems in real functions. This is the first time, I am trying to differentiate a complex function as, $$u=e^{ix}.$$

I am unsure whether, $$u'=ie^{ix}.$$ I tried emulating the same thing that we do in case of real functions.

Then, comes the next hurdle similar to these. How do we integrate $$y=-u\int\frac{vg(x)}{w(u,v)}dx +v\int\frac{ug(x)}{w(u,v)}dx,$$ when, $$u,v$$ are complex functions?

Say, for example, $$\int\frac{vg(x)}{w(u,v)}=\int\frac{e^{-ix}\csc(x)}{w(e^{ix},e^{-ix})}$$ I have no whatsoever idea about this whole process, since never did I perform an integration on complex functions.

Any clarification regarding this apparent issues will be highly appreciated.

• @Gonçalo Ah, and considering the fact the two real functions $\frac 12 (u+v)=...$ are solutions so ok, I am giving it a try. Commented Jun 29, 2023 at 9:34
• @Gonçalo I have added an answer. Is that what you meant ? Commented Jun 29, 2023 at 9:58
• @Gonçalo Ah, I am sorry. Is it okay, now? Thanks! Commented Jun 29, 2023 at 10:15

Inspired from the comment of @Gonçalo, I solved the problem, avoiding the complex functions.

We first note that if $$\frac{d^2y}{dx^2}+P\frac{dy}{dx}+Qy=g(x),$$ is the given differential equation then the corresponding homogeneous differential equation is $$\frac{d^2y}{dx^2}+P\frac{dy}{dx}+Qy=0\tag 1$$

If $$u,v$$ are a fundamental set of solutions to $$(1)$$ then, $$u_1=(u+v)$$ and $$v_1^*=(u-v)$$ are solutions of $$(1)$$ as well and they will be furthermore, linearly independent.

In this case, a simple calculation indicates $$u_1=2\cos x$$ and $$v_1=\frac{1}{2i}v_1^*=\frac{1}{2i}{2i\sin x}=\sin x.$$ We can observe, that $$v_1$$ is a solution of $$(1)$$ and linearly independent of $$u_1.$$

Now, we assume, the fundamental set of solutions to be $$u_1=\cos x$$ and $$v_1=\sin x.$$

The wronskian $$w(u_1,v_1)=1.$$

We use the formula of the method of variation of parameters as follows:

$$y=-u\int\frac{vg(x)}{w(u,v)}dx +v\int\frac{ug(x)}{w(u,v)}dx\implies -\cos x\int \csc x \sin xdx+\sin x\int \cos x\csc xdx=-\cos x\int dx+\sin x\int \frac{\cos x}{\sin x}dx=-x\cos x+\sin x\log |\sin x|.$$

So, the complete solution is, $$y=c_1e^{ix}+c_2e^{-ix}-x\cos x+\sin x\log |\sin x|.$$