It can be shown both bottom-up and top-down, but I prefer the bottom-up: Photosynthesis is usually an order of magnitude more efficient than photovoltaics:
https://en.wikipedia.org/wiki/Photosynthetic_efficiency...an individual leaf might be peak out at 3% efficient, but it is operating just a portion of the year (maybe about a third to a half at full performance) and also much light gets reflected, absorbed by branches, or misses the leaves entirely.
Additionally, photovoltaics peak at 40% efficiency but get about 15-20% efficiency typically and can function the entire year (unless fully covered by snow). And they're displacing electricity produced primarily from fossil fuels which are burned at 30-40% efficiency.
Now from a top-down perspective: forests (in this case calculated by replacing cropland with forests) are estimated to sequester about 2 to 10 tons of CO2 per acre per year. https://fas.org/sgp/crs/misc/R40562.pdf
In principle, an acre of about 40% solar photovoltaic system with a 25% capacity factor could produce about 3.5GWh per year. But typically, about exactly one tenth that is done in practice: 0.35GWh/year/acre.
Since you'd be displacing electricity from the US grid, which is currently about 420 grams of CO2 per kWh (based on my calculations of the most recent eia.gov figures, but you can find similar figures by Googling), that's equivalent to 147 metric tons of CO2 per acre per year for typical photovoltaics (and over 1000 metric tons per acre per year in the idealized case).
This person's calculations reach similar conclusions: https://www.solarpowerrocks.com/environment/installing-solar...
So absolutely, it's better to use solar panels than trees, at least until the grid is fully or nearly-fully saturated by solar.
...BUT once we fully clean the grid, trees have some advantages:
1) they efficiently suck CO2 out of the air and store it, not just produce the energy. That means you can actually draw-down CO2, producing negative emissions.
2) They're scalable. A tree is like a solar farm, CO2 direct air absorption system, and a chemical factory but can be planted as just a seed. It may not be "efficient", but being self-replicating and scalable is pretty powerful.