<s>[INST] Continuous antiderivative of $\frac{1}{1+\cos^2 x}$ without the floor function. By letting $u = 2x$ and $t = \tan \frac{u}{2}$, I found the continuous antiderivative of the function to be:
$$\int \frac{1}{1+\cos^2 x}dx\\= \int \frac{2}{3+\cos2x} dx\\ = \int \frac{1}{3+\cos u}du \\=\int \frac{\frac{2}{1+t^2}}{3+\frac{1-t^2}{1+t^2}}dt\\= \int\frac{1}{2+t^2}dt  \\= \frac{1}{\sqrt2}\arctan\left(\frac{\tan x}{\sqrt2}\right)  + 
\frac{\pi}{\sqrt2} \left\lfloor \frac{x + \frac{\pi}{2} }{\pi} \right\rfloor + C $$
(I graphically deduced the floor function bit as I am not familiar with its algebra.)
However, GeoGebra (notably not wolfram) does it better. It states, without the floor function, that the continuous antiderivative is also:
$$ \frac{x}{\sqrt2} + \frac{1}{\sqrt2} \arctan\left( \frac{(1-\sqrt2)\sin 2x}{(\sqrt2 -1)\cos2x +\sqrt2 + 1}\right) + C$$

How did GeoGebra accomplish such a feat? And how can I prove and apply such ingenuity?
 [/INST] With Floor Function
Let $(1+\cos^2x )^{-1} = f(x)$. Now as you found,
$$\int \frac{dx}{1+\cos^2 x} = \int \frac{\sec^2 x }{2+\tan^2 x} dx = \frac{1}{\sqrt{2} } \arctan\left(\frac{\tan x}{\sqrt 2}\right)$$
The issue is that integral of a continuous function should be continuous. The one we found is discontinuous at all odd multiples of $\pi/2$. Lets analyse for $x\in [\tfrac{(2k-1)\pi}{2}, \tfrac{(2k+1 ) \pi}{2}]$. Then
$$\begin{align}
\int_{0}^{x} f(t) dt &= \int_{0}^{\pi/2}f(t) dt+\int_{\pi/2}^{3\pi/2}f(t) dt ... \int_{(2k-1)\pi/2}^{x}f(t) dt \\
 &= \frac{\pi k}{\sqrt2} + \frac{1}{\sqrt 2}\arctan\left(\frac{\tan x}{\sqrt2}\right) \\
\end{align}$$
Now since $x\in  [\tfrac{(2k-1)\pi}{2}, \tfrac{(2k+1 ) \pi}{2}], $ then $x+\pi/2 \in [k\pi, (k+1)\pi]$ and so $\frac{x+\pi/2}{\pi} \in [k, k+1]$ so that $\lfloor\frac{x+\pi/2}{\pi}\rfloor = k$. Substituting in above equation gives:
$$\int_{0}^{x} f(t) dt =\frac{\pi}{\sqrt2}\left \lfloor\frac{x+\pi/2}{\pi}\right\rfloor  + \frac{1}{\sqrt 2}\arctan\left(\frac{\tan x}{\sqrt2}\right) $$
Without Floor Function
Couldn't do this one, will add if I find one.
</s>