This document proposes using an adaptive approach with a least mean square (LMS) algorithm to reduce the total harmonic distortion (THD) of a boost converter with pulse width modulation (PWM) switching. It simulates a boost converter in MATLAB and measures the THD with a proportional-integral-derivative (PID) controller alone and with both a PID controller and LMS algorithm. The results show that a boost converter with only a PID controller has a THD of 49.56%, while one with both PID and LMS achieves a lower THD of 25.28%, demonstrating the effectiveness of the adaptive LMS approach.