In the graph of a function symmetric with respect to the y-axis, a "Christmas tree" of height 1 is inscribed. It is known that the "branches" of the Christmas tree form an angle of $45^{0}$ with the vertical. Find the perimeter of the Christmas tree (i.e., the sum of the lengths of all green segments).
The Christmas tree consists of similar isosceles right triangles, the sum of the legs of which is known.

## Solution

First, let's calculate the sum of the lengths of all the green segments lying to the left of the y-axis. The left half of the Christmas tree consists of several similar triangles with angles $45^{0}, 45^{0}, 90^{0}$. The sum of the legs of these triangles is equal to the height of the Christmas tree, i.e., 1. Thus, the sum of the green legs is also 1, and the sum of the green hypotenuses is $\sqrt{2}$ times greater (since in each of the triangles, the hypotenuse is $\sqrt{2}$ times greater than the leg). Therefore, the sum of the green segments for half of the Christmas tree is $1+\sqrt{2}$, so the perimeter of the Christmas tree is $2(1+\sqrt{2})$.

## Answer

$2(1+\sqrt{2})$.