Is it easy to change your major after starting your PhD or masters, if it is necessary? I’m a mechanical engineering student and I am about to apply for a PhD.  I am certain about my desire to pursue advanced studies.   However, I have serious doubts in what I want to pursue my studies on.  

I have done research on structural health monitoring and power electronics.  At some point I thought that I had interest in electrical engineering and after some research I got interested in mathematical physics and then in applied mathematics.  

I started doing undergraduate research when I was a sophomore in the area of structural health monitoring. However my job was to write an algorithm to implement the methodology.     I realize now that what interested me was not structural health monitoring, but to study the origin and derivation of the theoretical equations.  I saw the profiles of various faculty in applied mathematics and I found some of their research interesting. 
Doubts about applying:


Although I have a GPA above 3.60 some programs require certain number of courses in mathematics.  I only have the mathematics included in the mechanical engineering program and one course of elementary statistics.  I have taken 5 courses in mathematics.  However I don’t show strength because out of the 5 courses, in 2 of them I got B when I was a freshman.  I think that the taking the elementary statistic course last semester was not a good idea.  I should have taken a more advanced course.
I have not taking any advanced course in mathematics.
The application to the program requires the GRE, TOEFL and subject test in math.  Some graduate programs say that the GRE math are not mandatory but not taking it puts you in disadvantage.  I am not sure I will have time to prepare for it and as a result I don't know if I will do well.
I have research experience, but it is not in this area.  In addition, the reference letters will be made by engineering professors and not math professors.
Since I am about to finish next semester, I don’t have much time to take more courses or do research in the area.


I looked at a few topics that I found interesting in applied mathematics but I haven’t done research in them.  As a result I don’t know if I will get tired or if I will change my mind once I start on the program.  If I were to apply for this program and I change my mind would it be easier to change even if it means going to other department?
Unfortunately, no, it's not so easy to change PhD programs.

It isn't like changing your undergrad major, where you just have to fill out some forms and get your advisors to sign off.  At the graduate level, each department does its own admissions.  So if you are in a mechanical engineering program and want to switch to applied math, you have to submit an application to the applied math program just like anyone else.  You'll be competing for a seat against every other applicant from around the world, most of whom will have completed a full undergrad mathematics major.

You might be able to improve your odds by getting to know faculty in the math program before you apply, perhaps discussing (or working on) research projects with someone there.  However, keep in mind that you will also need to stay in good standing in the engineering program, and you won't have a lot of spare time to explore math opportunities.

Also, from your description, your math background sounds much too light for entry into a math grad program.  Applied math can be more flexible than pure math, but having no advanced courses at all doesn't sound too good.  In fact, I'd be concerned that without advanced coursework, you may not even have enough of a sense of the field to know that it's really what you want to do.  Mathematics courses have a sharp change in flavor and difficulty as you transition from lower-level computational courses (calculus, differential equations, etc) to upper-level theory courses (real analysis, abstract algebra, topology).  Entering a PhD program having only the former kind of courses would be roughly analogous to being a go-kart enthusiast racing in the Indianapolis 500.  And it won't be easy to pick up extra math courses while in an engineering program; grad program requirements rarely allow for free electives.

Perhaps something that might better fit your situation is a post-baccalaureate ("post-bac") program.  These are one-year programs designed for students who have completed a bachelors and want to attend grad school in math, but need further preparation.  Such programs are offered by relatively few institutions, but I believe some of them are quite well-known in the community and have very good placement rates.