During an adiabatic process no heat enters or leaves the system which implies that the work done by the system is equal to the negative of the change in internal energy of the system. To find the work done by the system, we first start with the ideal gas formula because it relates the changing pressure and changing volume of the system to the changing temperature of the system. For an adiabatic process, this formula looks like $Vdp + Pdv = nRdt$, where $n$ is the amount of the gas usually measured in moles, and R is the ideal gas constant. After dividing the left side of the equation by $PV$ and the right side by $nRdT$ we obtain the differential equation $\frac{1}{P} dp + \frac{1}{V} dv = \frac{1}{T} dt$. Now, we use the differential form of the First Law of Thermodynamics Formula to obtain a worthy substitution for $dt$ and $\frac{1}{T}$. Because no heat enters or leaves the system of an adiabatic process, the differential equation of this formula becomes $du = -dw$. Now we can substitute $Pdv$ for $dw$ because our adiabatic system changes volume by an extremely small amount, allowing us to regard the pressure on the gas as being constant throughout the process. This leaves us with $du =-Pdv$. Now if we take, for example some other isometric process with initial and final temperatures, we will get the same change in internal energy or $du$. Because no work is done during an isometric process, the change in internal energy for  the isometric process is equivalent to the change in heat for the process or $dq$. After substituting $nC_{v}dt$ for $dq$, we can then substitute this in for $du$ in the equation of our adiabatic process which then gives us $nC_{v}dt$. We can now solve for $dt$ and then substitute that expression into $dt$ in our initial differential equation as a constraint. Now, to find a suitable substitution for $\frac{1}{T}$, we go to the ideal gas equation, and solve for $\frac{1}{T}$. We then plug this into the initial differential equation to obtain the expression $\frac{1}{P} dp + \frac{1}{V} dv = - \frac{R}{C_{v}V} dv$. Now we can set the equation equal to zero which gives us $\frac{1}{P}dp + (1+\frac{R}{C_{v}})\frac{1}{V} dv =0$. The term $(1+\frac{R}{C_{v}})$ can be written as $\frac {C_{v}}{C_{v}} + \frac{R}{C_{v}} = \frac{C_{v} +R}{C_{v}} = \frac{C_{p}}{C_{v}}= \gamma$. Now, we can integrate both sides of the equation to obtain $\int{\frac{1}{P}} dp + \int{\gamma\frac{1}{V}} dv = \int{0}$. After integrating, we obtain the equation $lnP + \gamma lnV = constant$. We can then exponentiate both sides to obtain $e^{lnP}e^{lnV^{\gamma}} = constant \Rightarrow PV^{\gamma} = constant$.
Now to derive the formula for the work done by a gas during an adiabatic process, we will begin with the equation $W = \int{P}dv$. To find a worthy substitute for $P$, we will turn to the equation just derived above, and apply it to an initial point and a final point. We will then solve for $P$, and substitute it for $P$ in the integral above which gives us $\int{P_{i}V_{i}^{\gamma}V^{-\gamma}}$. Then we can pull $P_{i}$ and $V_{i}^{\gamma}$ out of the integral and integrate what is left from $V_{i}$ to $V_{f}$. This leaves us with $\frac{P_{i}V_{i}^{\gamma}}{1-\gamma}[V_{f}^{1-\gamma}-V_{i}^{1-\gamma}]$. Now we can use the fact that $P_{i}V_{i}^{\gamma}= P_{f}V_{f}^{\gamma}$ to substitute $P_{f}V_{f}^{\gamma}$ for $P_{i}V_{i}^{\gamma}$ in our equation , which leads us to the final equation for the work done by a gas during an adiabatic process. The final equation is $W = \frac{P_{f}V_{f} - P_{i}V_{i}}{i-\gamma}$