<PAGE>

                                                                    Exhibit 10.4

                            NONCOMPETITION AGREEMENT

      This NON-COMPETITION AGREEMENT (the "Agreement") is made this 27th day of
May, 1998, by and between PHARSIGHT CORPORATION, a California corporation
("Pharsight"), and Joseph S.Gauthier ("Gauthier").

                                    RECITALS

      Gauthier is a substantial shareholder of MITCHELL AND GAUTHIER ASSOCIATES,
INC., a Delaware corporation ("the Company"). Pharsight, the Company, Edward E.
L. Mitchell and Gauthier have entered into an Asset Purchase Agreement dated as
of even date hereof (the "Acquisition Agreement") providing for the acquisition
(the "Acquisition") by Pharsight of certain of the assets of the Company (the
"Acquired Assets"), and the assumption of specified liabilities of the Company.
In connection therewith, Gauthier has agreed not to compete with Pharsight in
the manner and to the extent herein set forth. Gauthier is entering into this
Agreement as an inducement to Pharsight to execute the Acquisition Agreement and
consummate the Acquisition, with all of the attendant financial benefits to
Gauthier as a shareholder of the Company, and for the other consideration set
forth herein.

                                    AGREEMENT

      In consideration of the mutual covenants herein contemplated and intending
to be legally bound hereby, Pharsight and Gauthier agree as follows:

      1. Acknowledgements by Gauthier. Gauthier acknowledges that by virtue of
his position with the Company he has developed considerable expertise in the
business operations of the Company and has had access to extensive confidential
information with respect to the Company. Gauthier recognizes that Pharsight
would be irreparably damaged, and its substantial investment in the Acquired
Assets materially impaired, if Gauthier were to enter into an activity competing
with Pharsight's business in violation of the terms of this Agreement or if
Gauthier were to disclose or make unauthorized use of any confidential
information concerning the Acquired Assets or the business of the Company
conducted with the Acquired Assets. Accordingly, Gauthier expressly acknowledges
that he is voluntarily entering into this Agreement and that the terms and
conditions of this Agreement are fair and reasonable to Gauthier in all
respects.

      2. Confidentiality. Gauthier hereby agrees that, for a period of ten (10)
years from the date hereof, he will hold in confidence and not disclose to any
third party without the prior written consent of Pharsight, any material or
other information that contains trade secrets or information that has otherwise
been treated as confidential by the Company and related to the Acquired Assets
or treated as confidential by Pharsight (the "Confidential Information").
Gauthier further agrees that during this period of time, without the prior
written consent of Pharsight, he will not: (a) transfer the Confidential
Information to any third party; (b) use the Confidential Information for any
purpose other than the benefit of the Company or Pharsight; or
<PAGE>

(c) assist any person other than Pharsight to secure any benefit from the
Confidential Information. Gauthier further agrees that, at any time Pharsight
requests, he shall return to Pharsight all documents and materials of any nature
containing Confidential Information, and shall not make, retain or give to any
other person or entity any copies thereof.

      3. Non-competition. Until two (2) years after the date hereof, Gauthier
shall not, directly or indirectly, without the prior written consent of
Pharsight, (i) own, manage, operate, join, control, finance or participate in
the ownership, management, operation, control or financing of, or be connected
as an officer, director, employee, partner, principal, agent, representative,
consultant, licensor or otherwise with, any business or enterprise engaged in
any business which is competitive with the business of the Company, within each
of the geographical units which are listed in Appendix A hereto (the
"Territory"), or (ii) engage in any other manner, within the Territory, in any
business which is competitive with the business of the Company. For the purposes
of this Section 3, the "business of the Company" shall be defined as set forth
in Appendix B hereto. Notwithstanding the above, Gauthier shall not be deemed to
be engaged directly or indirectly in any business in contravention of
subparagraphs (i) or (ii) above, if: (x) Gauthier participates in any such
business solely as a passive investor in up to 1% of the equity securities of a
company or partnership, the securities of which are publicly traded; (y)
Gauthier is employed by a business or enterprise that is engaged primarily in a
business other than the business of the Company and Gauthier takes scrupulous
care not to and does in fact not apply his expertise at such business or
enterprise to that part of such business or enterprise that is or could be
competitive with the business of the Company; or (z) Gauthier is employed by a
large multi-divisional business, one or more divisions of which compete with the
Company's business, and Gauthier takes scrupulous care not to and does in fact
not consult with or otherwise apply his expertise at such division(s) of
business which compete with the Company's business.

      4. Non-interference. Gauthier further agrees that until two (2) years
following the date hereof he will not, without the prior written consent of
Pharsight, (i) interfere with the business of Pharsight by soliciting,
attempting to solicit, inducing, or otherwise causing any employee or consultant
of Pharsight to terminate his or her employment as such in order to become an
employee, consultant or independent contractor to or for any business that
competes with the business of Pharsight or to or for any company with which
Gauthier is associated in any way; or (ii) induce or attempt to induce any
customers, suppliers, distributors, resellers, or independent contractor of
Pharsight to terminate their relationships with, or to take any action that
would be disadvantageous to the business of, Pharsight.

      5. Consideration. In addition to the consideration set forth in the
recitals to this Agreement, as consideration for the obligations of Gauthier
under this Agreement, Pharsight shall pay to Gauthier, in cash, (i) on the first
anniversary of the date of this Agreement, the amount of $135,000, and (ii) on
the second anniversary of the date of this Agreement, the amount of $145,000.
The amounts payable hereunder are subject to Pharsight's right of setoff as set
forth in Section 6.8 of the Acquisition Agreement.

      6. Independence of Obligations. The covenants of Gauthier set forth in
this Agreement shall be construed as independent of any other agreement or
arrangement between Gauthier, on the one hand, and Pharsight or any of its
subsidiaries, on the other, and the


                                       2
<PAGE>

existence of any claim or cause of action by Gauthier against Pharsight or any
of its subsidiaries shall not constitute a defense to the enforcement of such
covenants against Gauthier.

      7. Equitable Relief. Gauthier expressly acknowledges that damages alone
will not be an adequate remedy for any breach by Gauthier of the covenants set
forth in Sections 2, 3, and 4 hereof and that the other parties hereto, in
addition to any other remedies which they may have, whether at law, in equity,
by contract or otherwise, shall be entitled, as a matter of right, to injunctive
relief, including specific performance, in any court of competent jurisdiction
with respect to any actual or threatened breach by Gauthier of any of said
covenants.

      8. Severability, etc.

            a. If any provision of this Agreement or any part of any such
provision is held under any circumstances to be invalid or unenforceable in any
jurisdiction, then (i) such provision or part thereof shall, with respect to
such circumstances and in such jurisdiction, be deemed amended to conform to
applicable laws so as to be valid and enforceable to the fullest possible
extent, (ii) the invalidity or unenforceability of such provision or part
thereof under such circumstances and in such jurisdiction shall not affect the
validity or enforceability of such provision or part thereof under any other
circumstances or in any other jurisdiction, and (iii) such invalidity of
enforceability of such provision or part thereof shall not affect the validity
or enforceability of the remainder of such provision or the validity or
enforceability of any other provision of this Agreement. Each provision of this
Agreement is separable from every other provision of this Agreement, and each
part of each provision of this Agreement is separable from every other part of
such provision.

            b. The parties intend that the covenant contained in Section 3 above
shall be construed as a series of separate covenants, one for each geographical
unit specified. Except for geographical coverage, each such separate covenant
shall be deemed identical in terms to the covenant contained in Section 3 above.
If, in any judicial proceeding, a court shall refuse to enforce any of the
separate covenants deemed included in this Agreement, then the unenforceable
covenant shall be deemed eliminated from these provisions for the purpose of
those proceedings to the extent necessary to permit the remaining separate
covenants to be enforced.

      9. Notices. Any notice or other communication required or permitted to be
delivered to any party under this Agreement shall be in writing and shall be
deemed properly delivered, given and received (i) when delivered by hand, (ii)
five days after deposit in the United States mail if by certified mail, (iii) on
the next business day if sent by courier or express delivery service that
guarantees next business day delivery, or (iv) upon confirmation if sent by
facsimile, to the address or facsimile telephone number set forth beneath the
name of such party below (or to such other address or facsimile telephone number
as such party shall have specified in a written notice given to the other
parties hereto):


                                       3
<PAGE>

                  If to Gauthier:

                  Joseph S. Gauthier
                  MITCHELL AND GAUTHIER ASSOCIATES, INC.
                  919 B Willowbrook Drive
                  Huntsville, Alabama 35802
                  Facsimile: (205) 883-5516

            Copy to:

                  Richard Stein
                  Hutchins, Wheeler & Dittmar
                  101 Federal Street
                  Boston, MA 02110
                  Facsimile: (617) 951-1295

            If to Pharsight:

                  PHARSIGHT CORPORATION
                  299 California Ave.
                  Suite 300
                  Palo Alto, CA 94306
                  Attention: Arthur H. Reidel, President
                  Facsimile: (650) 462-5610

            Copy to:

                  Cooley Godward LLP
                  5 Palo Alto Square
                  Palo Alto, California 94306
                  Attention: Andrei M. Manoliu, Esq.
                  Facsimile: (650) 857-0663

      10. Waiver of Breach. The failure or delay by Pharsight in enforcing any
provision of this Agreement shall not operate as a waiver thereof, and the
waiver by Pharsight or a breach of any provision of this Agreement by Gauthier
shall not operate or be construed as a waiver of any subsequent breach or
violation thereof. All waivers shall be in writing and signed by the party to be
bound.

      11. Assignment. This Agreement shall be assignable by Pharsight only to
any person, firm or corporation which may become a successor in interest by
purchase, merger or otherwise to Pharsight or the business operated by
Pharsight. This Agreement is not assignable by Gauthier.

      12. Entire Agreement; Amendment. This Agreement represents the entire
agreement and understanding of the parties with respect to the subject matter
hereof and


                                       4
<PAGE>

supersede all prior agreements and understandings of the parties in connection
therewith. It may not be altered or amended except by an agreement in writing
signed by the parties to be bound.

      13. Binding Effect. This Agreement shall be binding upon and inure to the
benefit of Pharsight and its permitted successors and assigns and Gauthier and
Gauthier's heirs and legal representatives.

      14. Governing Law. This Agreement shall be governed by and construed and
enforced in accordance with the laws of the Commonwealth of Massachusetts as
applied to contracts entered into between Massachusetts residents and to be
performed entirely within Massachusetts.

      IN WITNESS WHEREOF, the undersigned have executed this Agreement as of the
date first above written.


                                          /s/ Joseph S. Gauthier
                                          --------------------------------------
                                          Joseph S. Gauthier


                                          PHARSIGHT CORPORATION,
                                            a California corporation


                                          By: /s/ Arthur H. Reidel
                                             -----------------------------------

                        Gauthier Noncompetition Agreement


                                       5
<PAGE>

                                   APPENDIX A

                                    TERRITORY

      (1) Each county of Massachusetts, (2) all other states and territories of
the United States of America and provinces and territories of Canada, and (3)
any foreign country or territory in which the business of Pharsight is carried
on, or in which Pharsight intends to carry on business, as evidenced by
Pharsight's policy of seeking trademark protection for its product names or
otherwise.


                                       6
<PAGE>

                                   APPENDIX B

                                    BUSINESS

The "business of Pharsight" consists of

(1)   the development and marketing of software tools for distribution and
      licensing on a commercial basis to third parties for use in (i) the
      design, execution, management, and analysis of clinical drug trials and
      pre-clinical drug investigations, (ii) the simulation and modeling of
      clinical trials and pharmacokinetic and pharmacodynamic data and
      relationships, (iii) information management related to clinical and
      pre-clinical drug development programs, and (iv) the creation and
      maintenance of clinical and pre-clinical data repositories and retrieval
      systems and other pharmaceutical information management systems; and

(2)   the provision of consulting services in the foregoing areas.


                                       7