Let the amount partially invested out of $21,020 be x for 12% annual interest;
So, the interest gotten from this investment is;

Thus the amount from this investment is;

Thus, the rest of the money after x has been invested is;

And since this money suffered a loss of 5%, we have the amount from this investment as;

Thus, the total income from both investments is $2026.
Then, the total amount after both investments is;

Then, we can get the money invested x at 12% annual interest as;

The money invested at 12% annually is $18100.
The amount invested at 5% loss is;

The amount invested at 5% loss is $2920