To solve this problem, let's first define some variables. Let's call the number of apples produced by each apple tree "A", and the number of pears produced by each pear tree "P".
From the problem, we know that there are two apple trees, so the total number of apples produced by the apple trees is 2A. Similarly, there are three pear trees, so the total number of pears produced by the pear trees is 3P.
The problem also states that the total number of pieces of fruit is 126. So we can write the equation:
2A + 3P = 126
Next, it is mentioned that each pear tree produced two more pieces of fruit than either apple tree. This means that the number of pears produced by each pear tree is 2 more than the number of apples produced by each apple tree. Therefore, we can also express P in terms of A:
P = A + 2
Now we can substitute this expression for P in the equation we formed earlier:
2A + 3(A + 2) = 126
Simplifying this equation will give us the value of A, which represents the number of pieces of apples produced by each apple tree.