so I'm doing variation of parameters:
$$y'' - y = \frac{1}{e^x + e^{-x}}$$ Let the particular solution be the form of: $$y_p = u_1y_1 + u_2y_2$$
$$y_1 = e^x$$ $$y_2 = e^{-x}$$
Now we assume $u_1'y_1 + u_2'y_2 = 0$, let's call this equation (1). $$u_1'e^x + u_2'e^{-x}=0$$ Now we differentiate $y_1$ and $y_2$ to get the next equation, let's call it (2):
$$u_1'e^x - u_2'e^{-x} = \frac{1}{e^x + e^{-x}}$$
Right? So far so good. Now we add both equation (1) and (2) and we can solve for $u_1'$.
$$2u_1'e^x = \frac{1}{e^x + e^{-x}}$$
$$u_1' = \frac{1}{2} \bigg(\frac{1}{e^{2x} + 1}\bigg)$$
After integrating, I end up with $$u_1 = \frac{1}{4}\bigg(-\ln(e^{2x}+1)+2x\bigg)$$
So now I plug in $u_1'$ into either equation (1) or (2) to get $u_2'$ and to solve for $u_2$.
I will plug it into equation (1) since it's easier.
$$\frac{1}{2}\bigg(\frac{e^x}{e^{2x}+1}\bigg) + u_2'e^{-x} = 0$$
$$u_2'e^{-x} = -\frac{1}{2}\bigg(\frac{1}{e^x + e^{-x}}\bigg)$$
$$u_2' = -\frac{1}{2}\bigg(\frac{1}{1 + e^{-2x}}\bigg)$$
Now my professor said to integrate this, we should manipulate the integrand using rules of exponents, but I'm not sure how to do that...
So I just did this:
After integrating, I end up with:
$$\frac{1}{4}\bigg(-\ln(e^{-2x}+1) + \ln(e^{-2x})\bigg)$$
Now I have both $u_1$ and $u_2$, but the problem is I don't know how to get the answer to match the books.
My final answer is:
$$\frac{-\ln(e^{2x}+1)e^x + 2xe^x -\ln(e^{-2x}+1)e^{-x}-2xe^{-x}}{4}$$
The books answer is:
Is my answer equivalent to the books answer? If so, how can I make it match?

You have $$ \ln(e^{-2x}+1) = \ln(e^{-2x}) + \ln(1+e^{2x}) = -2x + \ln(1+e^{2x}) $$
Therefore $$ \frac{-e^x\ln(e^{2x}+1) - e^{-x}(-2x + \ln(e^{2x}+1))+2xe^x-2xe^{-x}}{4} \\ = \frac{2xe^x - (e^x+e^{-x})\ln(e^{2x}+1)}{4} $$
Here's an alternate way to integrate (likely what your prof meant) $$ -\frac{1}{2}\int \frac{1}{e^{-2x}+1}dx = -\frac{1}{2}\int \frac{e^{2x}}{e^{2x}+1}dx = -\frac{1}{4}\ln(e^{2x}+1) $$