Why are complex numbers used in electrical engineering?
The reason why you get complex exponential functions in EE is because the differential equations that appear have certain symmetries. These symmetries are encapsulated in the general linear group (GL). The solution to the differential equations are then the so called representations of the GL.

The way to think about it is that GL contains matrices that are linear transformations. These linear transformations are the symmetries of the differential equations. Then there is a group homomorphism \$\pi\$ that takes each linear transformation and spits out a function that is a solution to the differential equations.

As it happens these functions have the form \$e^{j \omega t}\$, where \$\omega\$ is some number. So we can now reconstruct the solution in the time domain \$f(t)\$ as a sum (integral really) of said functions. Hence you get the Fourier transform.

I’m skipping a lot of detail here. So much so that the above is not an entirely accurate description. However this is a very complicated topic and you need to read a couple of books to grasp it fully. This should give you a basic understanding of where the complex numbers are coming from.