I know the answers, but am having trouble writing the equation. Their ages are 17 and 8.5, and 14.5

Can I get help with the equaiton?

The sum of the ages of Sonia, Collin, and Ana is 40. Sonia is twice as old as Ana. Ana is 6 years younger than Collin. How old are they? Write and solve an algebra equation.(may have decimals)

It's odd, most of the time, questions regarding ages are integer numbers. I agree with your answer, here's how you could have done it.

Let A,S, and C represent the age of each person.

The sum of the ages of Sonia, Collin, and Ana is 40, so
S+C+A=40......(1)

Sonia is twice as old as Ana, so
S=2A.......(2)

Ana is 6 years younger than Collin, so
C=A+6......(3)

Notice how S and C both have been expressed in terms of A.

Now substitute (2) and (3) in (1) to get
S+C+A=40
(2A)+(A+6)+A = 40
4A+6=40
4A=34
A=8.5
The rest is just substituting A=8.5 in equations (2) and (3).

Hope that helps.