Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4018686
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:00:49+00:00 2026-05-20T10:00:49+00:00

I try to extract coefficient from equations (system of equations) into list (matrix). I

  • 0

I try to extract coefficient from equations (system of equations) into list (matrix). I have tried CoefficientList[poly, {var1, var2, ...}] but without success.

This simple example should explain my problem:

Eq1 = a D[U[x1, x2], {x1, 2}] + b D[V[x1, x2], {x2, 2}]

reproduce problem

Any advice?

Edit:

Daniel’s Lichtblau solution is very clear (thanks you), but what if the equation that looks like this?

Eq1 = a D[U[x1, x2], {x1, 2}] + b D[V[x1, x2], {x2, 2}] + c W[x1, x2]

A simple example can be resolved as follows:

additional question

Is there any more elegant solution? (particularly for more complex expressions)

Ps I can’t understand why, but this solution gives me the correct result.

reproduce problem

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:00:50+00:00Added an answer on May 20, 2026 at 10:00 am

    Firstly the partial derivatives are represented with Derivative, so the pattern needs to match that. Also, I don’t think you want to use CoefficientList as that would accept terms where both your expressions appear. All in all, the following should work:

    In[7]:= (Coefficient[Eq1, #] &) /@ {Derivative[2, 0][U][x1, x2], Derivative[0, 2][V][x1, x2]}
    Out[7]= {a, b}
    

    Here (Coefficient[Eq1, #] &) is an anonymous function that finds the coefficient of the argument, and /@ maps it to the list on the right.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm try to extract info from a MySQL DB into a MS SQL DB.
I try to extract specific data from an xml feed that comes from youtube.
When I try to extract text from my PDF files, it seems to insert
hello everyone i am try to extract value from the field of a JSF
I'm writing some quick code to try and extract data from an mp3 file
Whe i try try to extract the value: 18 total , from that json
So I am currently using SAX to try and extract some information from a
I have a big number stored in a string and try to extract a
This is part of my youtube project. I try to extract video information from
I try to extract all files from .zip containing subfolders in one folder. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.