I'll change Jean's name to Gene so I can use their initials for their ages
without conflicting J's.
When Joe was half as old as Kate, his cousin Gene was 38.
When Kate was half as old as Gene, then Joe himself was 17.
Their ages total 113.
Let J = Joe's age
Let K = Kate's age
Let G = Gene's age
Let x = the number of years ago it's been since Joe was half as old as Kate
Let y = the number of years ago it's been since Kate was half as old as Gene.
When Joe was half as old as Kate,(x years ago) his cousin Gene was 38.
So from that we get:
J - x = (K - x)/2 and G - x = 38
When Kate was half as old as Gene, (y years ago), then Joe himself was 17.
From that we get:
K - y = (G - y)/2 and J - y = 17
Their ages total 113
From that we get
J + K + G = 113
So we have 5 equations and 5 unknowns:
J - x = (K - x)/2
G - x = 38
K - y = (G - y)/2
J - y = 17
J + K + G = 113
Clear of fractions:
2J - 2x = K - x
G - x = 38
2K - 2y = G - y
J - y = 17
J + K + G = 113
Solve one of the 5 for a letter,
Substitute that in any of the other 4 that have that letter in them.
Then you'll have 4 equations in 4 unknowns.
Solve one of the 4 for a letter,
Substitute that in any of the other 3 that have that letter in them.
Then you'll have 3 equations in 3 unknowns.
Solve one of the 3 for a letter,
Substitute that in either of the other 2 that have that letter in it.
Then you'll have 2 equations in 2 unknowns.
Solve one of the 2 for a letter,
Substitute that in the other 1, if it has that letter in it.
Then you'll have 1 equations in 1 unknown.
Solve for that unknown.
Substitute back in the previous equation that had only 2 unknowns
Solve for that unknown.
etc.
You'll get:
J = 25, K = 32, G = 56, x = 18, y = 8
Checking:
18 years ago Joe was 7, Kate was 14, Gene was 38.
So Joe was half as old as Kate, and his cousin Gene was 38.
That checks.
8 years ago Joe was 17, Kate was 24, Gene was 48.
So Kate was half as old as Gene, and Joe himself was 17.
That checks.
Edwin