Will, Xavier and George had a total of 670 pens. The ratio of the number of pens Xavier had to the number of pens George had was 4:5. After Will and Xavier each gave away half of their pens, the 3 children had 395 pens left. How many pens did Xavier and George have at first?

w + x + g = 670 (1)

x : g = 4:5 (2)
1/2 (w + x) = 670 - 395 (3)

(2) => g = 5/4x (4)
(3) => w = 550 - x (5)
Put (4) and (5) into (1)
=> 550 - x + x + 5/4x = 670
5/4x = 120
x = 96

g = 5/4 * 96 = 120
w = 550 - 96 = 454
x = 96
g = 120
w = 454

let the number of pens each had to start with be

Will: w
Xavier: 4x
George: 5x
Then we are told that
w + 4x + 5x = 670
w/2 + 2x + 5x = 395
rewrite that as
w + 9x = 670
w + 14x = 790
now subtract to get
5w = 120
w = 24
So
Xavier+George = 96+120 = 216

To solve this problem, let's break it down into steps:

Step 1: Set up equations
Let's start by assigning variables to the number of pens each child had initially. Let's say the number of pens Xavier had is 4x, and the number of pens George had is 5x.

Step 2: Calculate the total number of pens initially
According to the problem, the total number of pens initially is 670. So we can write an equation:
4x + 5x = 670

Step 3: Simplify the equation
Combine like terms:
9x = 670

Step 4: Solve for x
Divide both sides of the equation by 9 to solve for x:
x = 670/9
x ≈ 74.44

Since we can't have a fraction of a pen, we'll round the value of x. Let's round it down to 74.

Step 5: Find the number of pens Xavier and George had initially
Now that we know x = 74, we can find the number of pens Xavier had initially:
4x = 4 * 74 = 296

And the number of pens George had initially:
5x = 5 * 74 = 370

So, Xavier initially had 296 pens and George initially had 370 pens.