In this paper, we studied the behaviour of compact relativistic objects with anisotropic matter distribution considering quadratic equation of state of Feroze and Siddiqui (2011). We specify the gravitational potential Z(x) in order to integrate the fields equations and there has been calculated the energy density, the radial pressure, the anisotropy and the mass function. The new solutions to the Einstein-Maxwell system of equations are found in term of elementary functions. For n=2, we have obtained the expressions for mass function, energy density, radius and metric functions of the model of Thirukkanesh and Ragel (2012) with polytropic equation of state.