Proper time between two events in a timelike separation

i just began to study special relavity, and i'd like to know if i made some mistake in one of the questions of the book i solved. the question is:

If we have to events A and B with timelike separation, show that the proper time $${\Delta}{\tau}=\int_{A}^{B}d{\tau}$$ is maximum when calculated along a straight line

Here's what i did: first, consider a reference frame where the moving particle is at rest spatially and put the point A at the origin and B at some point B=(t,0,0,0). I know that $${\tau}=t/\gamma$$. therefore, by integrating i got that $${\Delta}{\tau}=\frac{{\Delta}t}{\gamma}$$ but $$\gamma \geq 1$$ therefore $${\Delta}t \geq {\Delta}{\tau}$$. So i concluded that $${\Delta}{\tau}$$ is maximum when it's equal to $${\Delta}{t}$$ which is, $$\gamma=1$$. Formally, $${\Delta}t/\gamma$$ is a straight line with inclination $$1/\gamma$$. Is my approach correct? sorry if it's kinda trivial once it's well a known fact in SR. thanks in advance for your help

Here is what i read in classical field theory by Landau, i quote:

The time interval read by a clock is equal to the integral

$$\frac{1}{c}\int_{a}^{b}ds$$

taken along the world line of the clock. If the clock is at rest then its world line is clearly a line parallel to the $$t$$ axis; if the clock carries out a nonuniform motion in a closed path and returns to its starting point, then its world line will be a curve passing through the two points, on the straight world line of a clock at rest, corresponding to the beginning and end of the motion. On the other hand, we saw that the clock at rest always indicates a greater time interval than the moving one. Thus we arrive at the result that the integral

$$\int_{a}^{b}ds$$

taken between a given pair of world points, has its maximum value if it is taken along the straight world line joining these two points.

No, your approach doesn't make sense. Given A is at the origin and B is on the $$t$$ axis, the straight-line distance between them is $$Δτ = Δt$$. There's no gamma factor. If you computed straight-line distance in an arbitrary reference frame then you would have $$Δτ = Δt'/γ$$. But this is simply because $$Δt' = γΔt$$. You're just computing the same thing (straight-line distance) in different coordinates.

To show that the straight-line distance is maximal over all paths, you need to integrate over all paths. Define a path as a differentiable function $$\mathbf x(t)$$ with $$|\mathbf x'(t)| < c$$. Then calculate the length of that path using the spacetime metric, and show that it's maximized when $$\mathbf x'(t)$$ is constant. You can use any coordinate system since they're equivalent, but it'll be easiest to use the coordinates where A is at the origin and B is on the $$t$$ axis (in which $$\mathbf x'(t)$$ is identically zero if it's constant).