# Is work equal to area between graph and $x$-axis in a graph of force vs displacement?

Is this true even when displacement is not in direction of force?

$$W = \int (F\cos\theta)\text dx$$

and

area is $$\int F \text dx$$.

In my book that area is given as one of the definitions of work.

In general, it is the integral of the dot product of the force vector, and the displacement vector as $$\int \vec F \cdot \vec {dx}$$ which is dealt with in a scalar way as $$\int F\cos\theta dx$$
When the force is in the same direction of the displacement, then $$\theta=0$$ and $$\cos\theta=1$$. When they're not in the same direction, you can't omit the cosine factor or use the area under the F-x graph.
In general $$W=\int F_x\,dx+\int F_y\,dy+\int F_z\,dz$$, where subscripts indicate components of the force vector. If the displacement is in the $$x$$ direction only, then the 2nd and 3rd integrals will be zero. Also, if the force has only an $$x$$ component, then $$F_x=F$$. Otherwise you must use trigonometry to compute the various components.
Short answer : no. Your book is probably showing the graph of $$F_x(x)$$ or you've mistaken $$\int Fdx$$ for $$\int \vec{F}\cdot\vec{dS}$$ which is the definition of work. $$\vec{dS}$$ is the infinitesimal displacement vector.