I'm reading about $L^p$ spaces as a sort of self-studying thing. And usually when I read proofs, I'll try to fill in the steps that the author skips myself, but I'm having trouble with this one:
The proof is for: if $1 \leq p < q < r \leq \infty$, then $L^p \cap L^r \subset L^q$.
The author writes: Let $\lambda \in [0,1]$, and for $f \in L^q$,
\begin{align} \Vert f \Vert_{L^q} &= \left( \int_X \vert f \vert^q \right)^{\frac{1}{q}} \\ &= \left( \int_X\vert f \vert^{\lambda q} \vert f \vert^{(1-\lambda)q} \right)^{\frac{1}{q}} \\ &= \left( \Vert f \Vert_{L^p}^{\lambda q}\Vert f \Vert_{L^r}^{(1-\lambda)q} \right)^{\frac{1}{q}} \\ &= \Vert f \Vert_{L^p}^{\lambda }\Vert f \Vert_{L^r}^{(1-\lambda)} \end{align}
I understand how this proof shows that the $L^q$ norm of the function is controlled by the $L^p$ and $L^r$ norm of the function, so that if it's in $L^q \cap L^r$ then it's in $L^q$.
What I'm not getting is a minor detail of the proof: I'm not getting how I should get from the second line to the third line. At first I thought it's an application of Holder's inequality, but if I apply that to the expression in the second line, I get \begin{align*} \left(\int_X \vert f^{\lambda q} \vert^p\right)^\frac{1}{p}\left(\int_X \vert f^{(1-\lambda) q} \vert^r\right)^\frac{1}{r} \end{align*} but the expression on the third line is equal to \begin{align*} \left( \int_X \vert f \vert^p \right)^\frac{\lambda q}{p}\left( \int_X \vert f \vert^r \right)^\frac{(1-\lambda q)}{r} \end{align*} and I'm not sure how I can pull the $\lambda q$, $(1-\lambda)q$ out of the integral. I thought about it, but I don't think Jensen's inequality applies here.
Am I missing something obvious? Or do I need more sophisticated analysis machinery?
Thanks in advance!