When solving a problem like this you will need to break down the equation. The answer is actually really simple and easy.
For Kim's age we will use X as the variable. For her sister we will use Y.
y*3=x and X+Y=40 and that will get us our answer.
Now we are going to break it down. Kim is three times the age of her sister. So what number under 40 can be evenly distributed into 3 parts since we need to find a number three times greater than another number that can be added one time to itself to equal 40.
The answer to that question would be x=10.
Which means her younger sister is going to be 10
So taking that and plugging it into our equation we will get the following;
10*3(y*3) = (x)30
Which now means Kim's age is 30.
Now we check to make sure. Does 30 + 10 = 40? If so then that's your answer explained and in depth.