Both the sine and cosine functions can be represented by complex functions. They can be derived from Euler's formula eix = cosx +isinx
I transposed the paragraph below from an article telling how complex numbers used in conjunction with sinx, cosx, and ex are used to solve differential equations. I run into complex numbers all the time when the characteristic equation from the differential equation does not have real roots.
Differential equations: This formula really comes into its own when we need
to solve differential equations with constant coefficients. Then the goal is to find
the right numbers a; b so that the above functions which we just differentiated solve
a given equation. For example, electrical circuits lead to differential equations that
relate current, charge and voltage based on the circuit elements. Circuit elements
are described by certain parameters like inductance, resistance, and capacitance.
These become coefficients in the differential equation.