# Can Pythagorean triangles approximate arbitrary right triangles?

Question 1: Is there a non constant function $$f$$ such that

$$\int_{0}^1 f(1,x,\sqrt{1-x^2})dx = \int_{0}^1 f\left(1,\frac{1-x^2}{1+x^2},\frac{2x}{1+x^2}\right)dx.$$

Motivation: Let $$x^2 = y^2 + z^2$$. The limiting value $$l_R$$ of the arithmetic mean of function $$f(x,y,z)$$ where $$(x,y,z)$$ are the sides of an right triangle can be evaluated using

$$l_R = \int_{0}^1 f(1,x,\sqrt{1-x^2})dx$$

while that of Pythagorean triangles, $$l_P$$, can be evaluated using $$l_P = \int_{0}^1 f\left(1,\frac{1-x^2}{1+x^2},\frac{2x}{1+x^2}\right)dx.$$

If such a function exist, the arithmetic mean of this function invariant in the sense that it is the same for general right triangles and Pythagorean triangles.

In general, $$l_R$$ and $$l_P$$ will not be equal. But because Pythagorean triangles can be approximated by a uniform distribution as explained in the solution of this problem, $$l_R$$ and $$l_P$$ should not be very far apart. By choosing a suitable $$f$$ we can bring them closer as shown in the example below.

Let $$f(x,y,z) = \dfrac{x}{x+y+z}$$. We have

$$l_R = \int_{0}^1 \frac{dx}{1+x+\sqrt{1-x^2}} = \frac{\pi - 2\log 2}{4} \approx 0.439$$

$$l_P = \int_{0}^1 \frac{1+x^2}{2+x}dx = \frac{4\log 2 - 1}{4} \approx 0.443$$

As a by product, it yields the crude approximation $$\pi \approx 6\log 2 - 1 \approx 3.158$$.

• I don't see what your title has to do with your question. – Rahul Oct 4 '19 at 17:59
• @Rahul The first integral is the mean value of $f$ overall right triangles whose hypotenuse is $1$. The second integral is the mean value over all Pythagorean right triangles whose hypotenuse is $1$. So for a suitable $f$ the two means will be identical or differ by less than an arbitrary $\epsilon$ i.e. we have approximated one mean with another. – Nilotpal Kanti Sinha Oct 4 '19 at 18:04
• I do not think the “Pythagorean” integral makes any sense. In an integral over $x$ you cannot constrain $x$ to only rational numbers. In fact, almost all of your triangles will have irrational ratios and so will not be Pythagorean. – David K Oct 4 '19 at 19:35
• @NilotpalKantiSinha "mean value" makes very little sense to me in this context, since it's not clear that $dx$ is a natural measure in either space. In fact, the sets of values are the same; both integrals trace out the 'arc' of values $f(1, \sin\theta, \cos\theta)$ for $0\leq\theta\leq\pi/2$. They just do it at different 'velocities'. – Steven Stadnicki Oct 4 '19 at 19:36
• The answer to the title is obviously “yes” for reasons that do not require any kind of integration. Even if you could somehow make sense of the “Pythagorean” integral, the title would be asking a very clear question which is not considered in the text below it. – David K Oct 4 '19 at 20:51

Trivial solution: Pick any $$f$$ which is constant on the set $$S=\{(1,x,y):x^2+y^2=1,x\ge0,y\ge0\}$$ and nonconstant elsewhere, since $$S$$ contains all of the points where $$f$$ is evaluated by the integrals.
Nontrivial solution: The integrals $$l_R$$ and $$l_P$$ are two linear maps from a higher-dimensional space (all integrable functions $$\mathbb R^3\to\mathbb R$$) to a lower-dimensional space ($$\mathbb R$$). So is their difference $$l_R - l_P$$, therefore it must have a nontrivial null space. In other words, there are infinitely many functions $$f$$ with $$l_R(f) - l_P(f) = 0$$.
Here is a concrete construction. Choose any two functions $$g,h:\mathbb R^3\to\mathbb R$$ such that $$g,h,1$$ are linearly independent. If $$l_R(g)=l_P(g)$$ then we are done. Otherwise, define $$f=h+\alpha g$$. We want \begin{align} 0 &= l_R(f) - l_P(f) \\ &= l_R(h) - l_P(h) + \alpha (l_R(g) - l_P(g)) \\ \implies \alpha &= -\frac{l_R(h) - l_P(h)}{l_R(g) - l_P(g)}. \end{align} Then $$f$$ is the desired function. It is nonconstant since it is a linear combination of $$g$$ and $$h$$, which were chosen to be linearly independent of the constant function $$1$$.