Alternatives to PhysX include Bullet
are popular 2D physics engines.
If you want to learn how to write your own physics engine, I recommend the books Game Physics, 2nd ed.
, Real-Time Collision Detection
, Geometric Tools for Computer Graphics
and Game Physics Engine Development
. After those, there are several good talks (e.g. from GDC and Siggraph) related to game physics, also google can help with those, see e.g. Game Physics Engines: and Introduction
When writing a physics engine, I recommend keeping it strongly and strictly separated from DirectX 9. The rendering and physics part should not have any dependencies, since in a few years in the future, you will no longer be using DirectX 9, but want to keep using your physics engine, so it's best to plan for that in advance.
I don't want to patronize, but even though I consider myself an industry veteran, I think if I started writing a physics engine, it would take me well more than a man-year of development effort to create one that I might be mildly satisfied with.
Perhaps you are not looking for a complete 3D game physics engine, but are looking to implement simple physics-like behavior in your game. For that goal, writing your own physics-like logic update code is not that difficult, and can be simpler than integrating with a full-featured implementation.
Also, just for learning purposes, tackling a DIY project for full-blown game physics engines is of course ok, and if you're really looking towards that, good luck on your endeavour!