So, I was watching a lecture on YouTube for problems on conservation of energy and momentum and I don't quite understand this:
In this question, mass $M$ is released from the peak of the smooth movable wedge kept on a smooth horizontal surface and we are required to find speed of both when block reaches ground. Now, I do understand for mass+wedge system, along horizontal momentum is conserved as their are are no external horizontal forces but along vertical their is a vertical external force that is gravitational force. So we can apply momentum conservation along horizontal and not in vertical because of gravitational force.
My doubt is if gravitational force is considered as an external force this mean it changes the mechanical energy of the system so how come can we apply Total mechanical energy conservation?
As far as my understanding (that may be wrong) for conservative forces and law of conservation of total mechanical energy, for conservation of total mechanical energy there shouldn't be any work due to external forces, not even conservative forces that are external so that would mean their is no gravitational potential energy and only work done by gravity. I don't understand this are all conservative forces have potential energy irrespective of being internal and external?