Lamar invested is savings in two funds
Let the investment in fund B be $x
The investment in fund A will be $(x - 8000)
Fund A returned 2% anf fund B returned 5% profit
ROI on fund A is 2% and ROI on fund B is 5%
Let the profit of fund A be a
Let the profit of fund B be b
The formula to find the return on investment (ROI) is

To find the profit for A, by substituting the

The profit of A is

To find the profit for B, by substituting the

The profit of B is

Sum of the total profit is

Substitute for a and b into the above expression

Hence, the investment in fund B, x, is $17,000