First, I'll make f(x) = sin(px) + cos(px) because this expression shows up quite a lot, and such a substitution makes life a bit easier for us.
Let's apply the first derivative of this f(x) function.
![f(x) = \sin(px)+\cos(px)\\\\f'(x) = \frac{d}{dx}[f(x)]\\\\f'(x) = \frac{d}{dx}[\sin(px)+\cos(px)]\\\\f'(x) = \frac{d}{dx}[\sin(px)]+\frac{d}{dx}[\cos(px)]\\\\f'(x) = p\cos(px)-p\sin(px)\\\\ f'(x) = p(\cos(px)-\sin(px))\\\\](https://tex.z-dn.net/?f=f%28x%29%20%3D%20%5Csin%28px%29%2B%5Ccos%28px%29%5C%5C%5C%5Cf%27%28x%29%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Bf%28x%29%5D%5C%5C%5C%5Cf%27%28x%29%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5B%5Csin%28px%29%2B%5Ccos%28px%29%5D%5C%5C%5C%5Cf%27%28x%29%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5B%5Csin%28px%29%5D%2B%5Cfrac%7Bd%7D%7Bdx%7D%5B%5Ccos%28px%29%5D%5C%5C%5C%5Cf%27%28x%29%20%3D%20p%5Ccos%28px%29-p%5Csin%28px%29%5C%5C%5C%5C%20f%27%28x%29%20%3D%20p%28%5Ccos%28px%29-%5Csin%28px%29%29%5C%5C%5C%5C)
Now apply the derivative to that to get the second derivative
![f''(x) = \frac{d}{dx}[f'(x)]\\\\f''(x) = \frac{d}{dx}[p(\cos(px)-\sin(px))]\\\\ f''(x) = p*\left(\frac{d}{dx}[\cos(px)]-\frac{d}{dx}[\sin(px)]\right)\\\\ f''(x) = p*\left(-p\sin(px)-p\cos(px)\right)\\\\ f''(x) = -p^2*\left(\sin(px)+\cos(px)\right)\\\\ f''(x) = -p^2*f(x)\\\\](https://tex.z-dn.net/?f=f%27%27%28x%29%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Bf%27%28x%29%5D%5C%5C%5C%5Cf%27%27%28x%29%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Bp%28%5Ccos%28px%29-%5Csin%28px%29%29%5D%5C%5C%5C%5C%20f%27%27%28x%29%20%3D%20p%2A%5Cleft%28%5Cfrac%7Bd%7D%7Bdx%7D%5B%5Ccos%28px%29%5D-%5Cfrac%7Bd%7D%7Bdx%7D%5B%5Csin%28px%29%5D%5Cright%29%5C%5C%5C%5C%20f%27%27%28x%29%20%3D%20p%2A%5Cleft%28-p%5Csin%28px%29-p%5Ccos%28px%29%5Cright%29%5C%5C%5C%5C%20f%27%27%28x%29%20%3D%20-p%5E2%2A%5Cleft%28%5Csin%28px%29%2B%5Ccos%28px%29%5Cright%29%5C%5C%5C%5C%20f%27%27%28x%29%20%3D%20-p%5E2%2Af%28x%29%5C%5C%5C%5C)
We can see that f '' (x) is just a scalar multiple of f(x). That multiple of course being -p^2.
Keep in mind that we haven't actually found dy/dx yet, or its second derivative counterpart either.
-----------------------------------
Let's compute dy/dx. We'll use f(x) as defined earlier.
![y = \ln\left(\sin(px)+\cos(px)\right)\\\\y = \ln\left(f(x)\right)\\\\\frac{dy}{dx} = \frac{d}{dx}\left[y\right]\\\\\frac{dy}{dx} = \frac{d}{dx}\left[\ln\left(f(x)\right)\right]\\\\\frac{dy}{dx} = \frac{1}{f(x)}*\frac{d}{dx}\left[f(x)\right]\\\\\frac{dy}{dx} = \frac{f'(x)}{f(x)}\\\\](https://tex.z-dn.net/?f=y%20%3D%20%5Cln%5Cleft%28%5Csin%28px%29%2B%5Ccos%28px%29%5Cright%29%5C%5C%5C%5Cy%20%3D%20%5Cln%5Cleft%28f%28x%29%5Cright%29%5C%5C%5C%5C%5Cfrac%7Bdy%7D%7Bdx%7D%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Cleft%5By%5Cright%5D%5C%5C%5C%5C%5Cfrac%7Bdy%7D%7Bdx%7D%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Cleft%5B%5Cln%5Cleft%28f%28x%29%5Cright%29%5Cright%5D%5C%5C%5C%5C%5Cfrac%7Bdy%7D%7Bdx%7D%20%3D%20%5Cfrac%7B1%7D%7Bf%28x%29%7D%2A%5Cfrac%7Bd%7D%7Bdx%7D%5Cleft%5Bf%28x%29%5Cright%5D%5C%5C%5C%5C%5Cfrac%7Bdy%7D%7Bdx%7D%20%3D%20%5Cfrac%7Bf%27%28x%29%7D%7Bf%28x%29%7D%5C%5C%5C%5C)
Use the chain rule here.
There's no need to plug in the expressions f(x) or f ' (x) as you'll see in the last section below.
Now use the quotient rule to find the second derivative of y
![\frac{d^2y}{dx^2} = \frac{d}{dx}\left[\frac{dy}{dx}\right]\\\\\frac{d^2y}{dx^2} = \frac{d}{dx}\left[\frac{f'(x)}{f(x)}\right]\\\\\frac{d^2y}{dx^2} = \frac{f''(x)*f(x)-f'(x)*f'(x)}{(f(x))^2}\\\\\frac{d^2y}{dx^2} = \frac{f''(x)*f(x)-(f'(x))^2}{(f(x))^2}\\\\](https://tex.z-dn.net/?f=%5Cfrac%7Bd%5E2y%7D%7Bdx%5E2%7D%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Cleft%5B%5Cfrac%7Bdy%7D%7Bdx%7D%5Cright%5D%5C%5C%5C%5C%5Cfrac%7Bd%5E2y%7D%7Bdx%5E2%7D%20%3D%20%5Cfrac%7Bd%7D%7Bdx%7D%5Cleft%5B%5Cfrac%7Bf%27%28x%29%7D%7Bf%28x%29%7D%5Cright%5D%5C%5C%5C%5C%5Cfrac%7Bd%5E2y%7D%7Bdx%5E2%7D%20%3D%20%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29-f%27%28x%29%2Af%27%28x%29%7D%7B%28f%28x%29%29%5E2%7D%5C%5C%5C%5C%5Cfrac%7Bd%5E2y%7D%7Bdx%5E2%7D%20%3D%20%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29-%28f%27%28x%29%29%5E2%7D%7B%28f%28x%29%29%5E2%7D%5C%5C%5C%5C)
If you need a refresher on the quotient rule, then
![\frac{d}{dx}\left[\frac{P}{Q}\right] = \frac{P'*Q - P*Q'}{Q^2}\\\\](https://tex.z-dn.net/?f=%5Cfrac%7Bd%7D%7Bdx%7D%5Cleft%5B%5Cfrac%7BP%7D%7BQ%7D%5Cright%5D%20%3D%20%5Cfrac%7BP%27%2AQ%20-%20P%2AQ%27%7D%7BQ%5E2%7D%5C%5C%5C%5C)
where P and Q are functions of x.
-----------------------------------
This then means
![\frac{d^2y}{dx^2} + \left(\frac{dy}{dx}\right)^2 + p^2\\\\\frac{f''(x)*f(x)-(f'(x))^2}{(f(x))^2} + \left(\frac{f'(x)}{f(x)}\right)^2 + p^2\\\\\frac{f''(x)*f(x)-(f'(x))^2}{(f(x))^2} +\frac{(f'(x))^2}{(f(x))^2} + p^2\\\\\frac{f''(x)*f(x)-(f'(x))^2+(f'(x))^2}{(f(x))^2} + p^2\\\\\frac{f''(x)*f(x)}{(f(x))^2} + p^2\\\\](https://tex.z-dn.net/?f=%5Cfrac%7Bd%5E2y%7D%7Bdx%5E2%7D%20%2B%20%5Cleft%28%5Cfrac%7Bdy%7D%7Bdx%7D%5Cright%29%5E2%20%2B%20p%5E2%5C%5C%5C%5C%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29-%28f%27%28x%29%29%5E2%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20%5Cleft%28%5Cfrac%7Bf%27%28x%29%7D%7Bf%28x%29%7D%5Cright%29%5E2%20%2B%20p%5E2%5C%5C%5C%5C%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29-%28f%27%28x%29%29%5E2%7D%7B%28f%28x%29%29%5E2%7D%20%2B%5Cfrac%7B%28f%27%28x%29%29%5E2%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20p%5E2%5C%5C%5C%5C%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29-%28f%27%28x%29%29%5E2%2B%28f%27%28x%29%29%5E2%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20p%5E2%5C%5C%5C%5C%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20p%5E2%5C%5C%5C%5C)
Note the cancellation of -(f ' (x))^2 with (f ' (x))^2
------------------------------------
Let's then replace f '' (x) with -p^2*f(x)
This allows us to form ( f(x) )^2 in the numerator to cancel out with the denominator.
![\frac{f''(x)*f(x)}{(f(x))^2} + p^2\\\\\frac{-p^2*f(x)*f(x)}{(f(x))^2} + p^2\\\\\frac{-p^2*(f(x))^2}{(f(x))^2} + p^2\\\\-p^2 + p^2\\\\0\\\\](https://tex.z-dn.net/?f=%5Cfrac%7Bf%27%27%28x%29%2Af%28x%29%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20p%5E2%5C%5C%5C%5C%5Cfrac%7B-p%5E2%2Af%28x%29%2Af%28x%29%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20p%5E2%5C%5C%5C%5C%5Cfrac%7B-p%5E2%2A%28f%28x%29%29%5E2%7D%7B%28f%28x%29%29%5E2%7D%20%2B%20p%5E2%5C%5C%5C%5C-p%5E2%20%2B%20p%5E2%5C%5C%5C%5C0%5C%5C%5C%5C)
So this concludes the proof that
when ![y = \ln\left(\sin(px)+\cos(px)\right)\\\\](https://tex.z-dn.net/?f=y%20%3D%20%5Cln%5Cleft%28%5Csin%28px%29%2B%5Ccos%28px%29%5Cright%29%5C%5C%5C%5C)
Side note: This is an example of showing that the given y function is a solution to the given second order linear differential equation.