The main purpose of this paper is to conduct momentum and energy analysis on non-Newtonian fluid flow in a semi-permeable medium between two infinite vertical flat plates considering the influences of medium porosity, heat source and magnetic field. In this study, porosity, heat source and magnetic field terms are considered to be variable. Initially, partial differential equations of momentum and energy are derived and turned into ordinary differential equations utilizing a similarity solution. Afterwards, a system of differential equations is solved by Least Square Method (LSM) and subsequently reliable functions are proposed for temperature and velocity distributions. To assess the precision of this method, the equations are also solved by a numerical method and an analytical approach known as Galerkin Method (GM). Regarding the comparisons, it can be implied that when the values of magnetic field, heat source and porosity are constant along the channel width, both LSM and GM methods are efficient and appropriate agreement is observed between the results. However, for the case in which these parameters linearly vary along the channel width, Galerkin approach shows more accurate results. Ultimately, the influences of Hartman number, porosity and heat source parameters on the velocity and temperature distributions are discussed.