For a proper analysis (rather than the usual assumed depth to fixity) the problem is a beam on elastic foundation with variable lateral spring stiffness.
The usual numerical solution is to discretise the pile and soil into somewhere between 10 and 20 elements. Where the load is nominally static, simple lateral springs can be used to represent the soil. If a dynamic load is important, some estimate of the damping coefficient of the soil is required to be added, and a dynamic FE model will be needed.
With very soft soils, the issue of slow lateral movement of the pile through the soil should be carefully considered.
Dr Harry Poulos has published considerable on this issue.
Method above agreed. Most probably one of the easyest methods to generate an adequate result.
Be sure you are avare of the lateral forces within the springs. They need to be set in relation to the max. admissible resistance provided by the soil.