5 kg of some liquid at 10 Celsius is mixed with 1 kg of the same liquid at 40 Celsius. What is the final equilibrium temperature? Ignore any heat flow with the containers and/or surroundings.

Q = m*C*(Tf-Ti)

where Q is the heat, m is the mass of the substance, C is the specific heat, Tf is the final temperature; Ti is the initial temperature.
deltaQ = 0

or

5*C(Tf - 10) + 1*C*(Tf - 40) = 0

divide by C:

5*(Tf-10) + (Tf-40) = 0

Solve for Tf.