Simplify $\mathbb{Q}(\pi^3+\pi^2, \pi^8+\pi^5)$
Let $a=\pi^3+\pi^2$ and $b=\pi^8+\pi^5$. Then
$$ \pi=\frac{3b(1-a)+(a^4+3a^3)}{b(a-3)+(3a^3+3a^2)} $$
so you can take $f(\pi)=\pi$. How did I obtain this formula ? I tried to find the minimal polynomial of $\pi$ over ${\mathbb Q}(a,b)$, by applying the Euclidean algorithm to $X^3+X^2-a$ and $X^8+X^5-b$.
The last nonzero term produced by this algorithm is $3b(1-a)+(a^4+3a^3)-X(b(a-3)+(3a^3+3a^2))$.