  In this note we study the U-duality invariant coefficient functions of higher
curvature corrections to the four-graviton scattering amplitude in type IIB
string theory compactified on a torus. The main focus is on the $D^6R^4$ term
that is known to satisfy an inhomogeneous Laplace equation. We exhibit a novel
method for solving this equation in terms of a Poincar\'e series ansatz and
recover known results in $D=10$ dimensions and find new results in $D<10$
dimensions. We also apply the method to modular graph functions as they arise
from closed superstring one-loop amplitudes.
