How to find the sum with Mathematica?

Use RootReduce

Sum[Tan[(4*j - 3)*Pi/180], {j, 1, 45}] // RootReduce

(* 45 *)

Sometimes the easiest approach is to just divide it up into steps and see which transformations can be done reasonably quickly. First, I define the expression:

expr = Sum[Tan[(4*j - 3)*Pi/180], {j, 1, 45}];

Verify its result numerically:

N[expr]

45.

This is likely, but not necessarily, exact. Thus, the strategy will be trying to prove that some transformation of expr - 45 is 0 exactly. Since expr is primarily trigonometric, there's a few functions that come to mind immediately. TrigExpand does not evaluate quickly, but TrigToExp shows a fairly self-similar form of a group of fractions. I find fractions usually become easier to work with after Apart, and it turns out that transformation is also reasonably quick. However, after Apart the numbers do not precisely add up to anything specific, so the 45 would seem to be a residual effect of several independent parts of this expression.

At this point I tried to see if Simplify could sort it out:

Simplify[Apart[TrigToExp[expr]] - 45]

0

Which is an exact result, though derived through somewhat convoluted means, which shows that expr == 45 exactly, so long as no errors occurred during TrigToExp and Apart, which are both supposed to be complex safe.