I have a 3 degree of freedom arm robot and by using D-H representation method get the forward kinematics but I can't derive the inverse kinematics can someone help me please ?
The D-H-representation is a good starting point for an inverse kinematics solver. Usually, DH means, that the joints of the kinematic chain are stored in a matrix. This can be converted into an array in computer code. As a result, the forward model can be built. A forward model takes as input the angle of the joints and prints out the xy-coordinates for each link. The xy-coordinates can be copied to the graphics engine which will display the kinematic chain to the screen.
So the open question is how to use the forward model in the inverse direction? That means, the solver gets the x/y coordinates and should calculate the angles for each joint. At first let me explain which technique doesn't work. Calculating the values with algebra equations isn't a good choice. It might work for simpler models, but if the kinematic chain gets more complicated and has some underactuation in it, the equation will fail to return the correct values. The better way is a sampling approach. The existing forward model is used by a sampling based solver to determine the angles with trial and error. A possible sampling technique is Monte-carlo-tree-search.
For a three DOF arm the IK is pretty simple. You can find a closed form with a bunch of sin / cosine operations to derive the angles for a given TCP pose directly.
If you are too lazy to do the math, have a look at OpenRAVE's IK-Fast. It is an open source lib that can generate IK solvers for almost all kinematic types.