1. The problem statement, all variables and given/known data

I am confused with why the author uses this form for periodic sound waves.

Why did he use cosine instead?
Later, he states

Note he uses sin this time.

I know that the difference between sine and cosine is the phase offset, by 90 degrees.

But why did the author uses cosine for the first equation, and use sine in the second?

There must be a reason for this. He has been consistent with sin convention with traveling waves (previous chapter).
---edited----
For the second equation I understood now that it was derived using the first equation, and thus taking the partial s / partial x we get sine instead. So why did he use cos in the beginning, anyway?

I also understand that sound waves is longitudinal wave.

It is a little confusing, but it really doesn't matter whether you use sine or cosine - just a matter of where on the wave you choose x=0 and t=0. Perhaps the author wanted to end up with sine for the pressure wave so he started with cosine for the displacement to achieve that end.