a university student completed courses worth 3 credits and some courses worth 4 credits. The student earned a total of 54 credits after completing 15 courses. How many courses worth 4 credits did the student complete.

Let the number of courses worth 4 credits that the student completed be x.

Then, the number of courses worth 3 credits that the student completed is 15 - x.
The total number of credits earned by the student from courses worth 4 credits is 4x.
The total number of credits earned by the student from courses worth 3 credits is 3(15 - x).
So, we have the equation 4x + 3(15 - x) = 54.
Simplifying the equation gives 4x + 45 - 3x = 54.
Combining like terms gives x + 45 = 54.
Subtracting 45 from both sides gives x = 9.
Therefore, the student completed 9 courses worth 4 credits. Answer: \boxed{9}.