# Formulating a word problem

I know this looks simple and I understand it and I've been able to find the solution, however I am not sure how to formulate this with equations. The problem is: A basket can hold 5 apples and 4 oranges together, while it can hold 12 oranges alone. (This particular constraint is necessary). If there are total 39 baskets, how many of these will you fill up with apples and oranges, and the remaining with oranges such that the total number of apples and oranges across all the baskets is equal.

So, out of the 39 baskets, if I fill up 36 of those with 5 apples and 4 oranges in each, I'll have a total of 180 apples and 144 oranges, while the remaining 3 baskets can hold 12 oranges each thus making it a total of 36 oranges in those 3 baskets. And hence I'll have a total of 180 oranges and 180 apples.

Your solution is just fine. If you want to do it "with equations" then let $x$ be the number of mixed baskets. Then $39-x$ is the number of baskets with just oranges.
The total number of apples is $5x$. The total number of oranges is $$4x + 12(39-x) .$$
Set those equal and solve for $x$.