Assume that the differential equation
$$y'''+p(x)y''+q(x)y'+r(x)y=0$$has solutions $y_1(x)$, $y_2(x)$, $y_3(x)$ on the real line such that
$$y_1(x)^2+y_2(x)^2+y_3(x)^2=1$$for all real $x$. Let
$$f(x)=y_1'(x)^2+y_2'(x)^2+y_3'(x)^2.$$Find constants $A$ and $B$ such that $f(x)$ is a solution to the differential equation
$$y'+Ap(x)y=Br(x).$$
1. We start with the given differential equation:
   \[
   y''' + p(x)y'' + q(x)y' + r(x)y = 0 \quad \quad (0)
   \]
   and the given condition:
   \[
   y_1(x)^2 + y_2(x)^2 + y_3(x)^2 = 1 \quad \text{for all } x.
   \]

2. Differentiating the given condition with respect to \( x \):
   \[
   2y_1(x)y_1'(x) + 2y_2(x)y_2'(x) + 2y_3(x)y_3'(x) = 0
   \]
   Simplifying, we get:
   \[
   y_1(x)y_1'(x) + y_2(x)y_2'(x) + y_3(x)y_3'(x) = 0 \quad \quad (1)
   \]

3. Differentiating equation (1) with respect to \( x \):
   \[
   y_1(x)y_1''(x) + (y_1'(x))^2 + y_2(x)y_2''(x) + (y_2'(x))^2 + y_3(x)y_3''(x) + (y_3'(x))^2 = 0
   \]
   Grouping the terms involving second derivatives and first derivatives, we get:
   \[
   y_1(x)y_1''(x) + y_2(x)y_2''(x) + y_3(x)y_3''(x) + f(x) = 0 \quad \quad (2)
   \]
   where \( f(x) = (y_1'(x))^2 + (y_2'(x))^2 + (y_3'(x))^2 \).

4. Differentiating equation (2) with respect to \( x \):
   \[
   y_1(x)y_1'''(x) + y_1'(x)y_1''(x) + y_2(x)y_2'''(x) + y_2'(x)y_2''(x) + y_3(x)y_3'''(x) + y_3'(x)y_3''(x) + f'(x) = 0
   \]
   Grouping the terms involving third derivatives, second derivatives, and first derivatives, we get:
   \[
   y_1(x)y_1'''(x) + y_2(x)y_2'''(x) + y_3(x)y_3'''(x) + (y_1'(x)y_1''(x) + y_2'(x)y_2''(x) + y_3'(x)y_3''(x)) + f'(x) = 0
   \]
   Using the definition of \( f(x) \), we can rewrite the second derivative terms:
   \[
   y_1(x)y_1'''(x) + y_2(x)y_2'''(x) + y_3(x)y_3'''(x) + \frac{1}{2}f'(x) + f'(x) = 0
   \]
   Simplifying, we get:
   \[
   y_1(x)y_1'''(x) + y_2(x)y_2'''(x) + y_3(x)y_3'''(x) + \frac{3}{2}f'(x) = 0 \quad \quad (3)
   \]

5. Since \( y_1(x) \), \( y_2(x) \), and \( y_3(x) \) are solutions of the original differential equation (0), we have:
   \[
   y_1'''(x) + p(x)y_1''(x) + q(x)y_1'(x) + r(x)y_1(x) = 0
   \]
   Multiplying by \( y_1(x) \):
   \[
   y_1(x)y_1'''(x) + p(x)y_1(x)y_1''(x) + q(x)y_1(x)y_1'(x) + r(x)y_1(x)^2 = 0
   \]
   Similarly for \( y_2(x) \) and \( y_3(x) \):
   \[
   y_2(x)y_2'''(x) + p(x)y_2(x)y_2''(x) + q(x)y_2(x)y_2'(x) + r(x)y_2(x)^2 = 0
   \]
   \[
   y_3(x)y_3'''(x) + p(x)y_3(x)y_3''(x) + q(x)y_3(x)y_3'(x) + r(x)y_3(x)^2 = 0
   \]

6. Adding these three equations, we get:
   \[
   y_1(x)y_1'''(x) + y_2(x)y_2'''(x) + y_3(x)y_3'''(x) + p(x)(y_1(x)y_1''(x) + y_2(x)y_2''(x) + y_3(x)y_3''(x)) + q(x)(y_1(x)y_1'(x) + y_2(x)y_2'(x) + y_3(x)y_3'(x)) + r(x)(y_1(x)^2 + y_2(x)^2 + y_3(x)^2) = 0
   \]
   Using the given conditions and previous results:
   \[
   y_1(x)y_1'''(x) + y_2(x)y_2'''(x) + y_3(x)y_3'''(x) + p(x) \cdot 0 + q(x) \cdot 0 + r(x) \cdot 1 = 0
   \]
   Simplifying, we get:
   \[
   y_1(x)y_1'''(x) + y_2(x)y_2'''(x) + y_3(x)y_3'''(x) + r(x) = 0
   \]

7. Substituting this result into equation (3):
   \[
   -r(x) + \frac{3}{2}f'(x) = 0
   \]
   Solving for \( f'(x) \):
   \[
   f'(x) = \frac{2}{3}r(x)
   \]

8. We need to find constants \( A \) and \( B \) such that \( f(x) \) is a solution to the differential equation:
   \[
   y' + Ap(x)y = Br(x)
   \]
   Comparing with \( f'(x) = \frac{2}{3}r(x) \), we see that:
   \[
   A = 0 \quad \text{and} \quad B = \frac{2}{3}
   \]

The final answer is \( \boxed{ A = 0 } \) and \( B = \frac{2}{3} \)