I came across this in a control engineering textbook: consider the transfer function $G(s)$ as the following ratio of functions, where the denominator is a polynomial in s: $$G(s) = \frac{p(s)}{q(s)} = \frac{p(s)}{(s+s_{1})(s+s_{2})...(s+s_{n})}$$ Applying the sinusoidal input $x(t) =X\sin\omega t $ to this transfer function, the output $Y(s)$ is given as: $$Y(s) = \frac{p(s)}{q(s)}X(s) = \frac{p(s)}{q(s)}\frac{\omega X}{s^2 + \omega^2}$$ Performing a partial fraction expansion on the above expression yields: $$Y(s) = G(s)\frac{\omega X}{s^2 + \omega^2} = \frac{a}{s + j \omega} + \frac{\bar{a}}{s - j \omega} + \frac{b_{1}}{s + s_{1}} + \frac{b_{2}}{s + s_{2}} + ... + \frac{b_{n}}{s + s_{n}}$$ Assuming that the roots $s_{1}, s_{2}$ and $s_{n}$ are negative, as time approaches infinity, these decay to zero in the time domain; as such, the expression I'm interested in is: $$Y(s) = G(s)\frac{\omega X}{s^2 + \omega^2} = \frac{a}{s + j \omega} + \frac{\bar{a}}{s - j \omega}$$
How do I solve for the complex constants $a$ and $\bar{a}$? In the book I am reading, $a$ has been found assuming that $s= -j\omega$, giving:
$$ a = -\frac{XG(-j\omega)}{2j}$$
Similarly, assuming that $s= +j\omega$, $\bar{a}$ is evaluated as: $$\bar{a} = \frac{XG(j\omega)}{2j}$$
Can you justify this to me mathematically?
Multiplication of $Y$ with $s^2+\omega^2$ gives \begin{align*} Y(s)\left(s^2+\omega^2\right)=G(s)\omega X &=a\frac{s^2+\omega^2}{s+j\omega}+\bar{a}\frac{s^2+\omega^2}{s-j\omega}\\ &=a\left(s-j\omega\right)+\bar{a}\left(s+j\omega\right)\tag{1} \end{align*}
Evaluation of (1) at $s=-j\omega$ gives \begin{align*} G\left(-j\omega\right)\omega X&=a\left(-2j\omega\right)\\ \color{blue}{a}&\color{blue}{=-\frac{XG\left(-j\omega\right)}{2j}} \end{align*} according to the claim. The calculation for $\bar{a}$ is similarly.